FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
coder/.github/workflows/stale.yaml at main · coder/coder · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
coder
/
coder
Public
Notifications
You must be signed in to change notification settings
Fork
1.5k
Star
14.3k
Code
Issues
758
Pull requests
206
Discussions
Actions
Projects
Security and quality
35
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
coder
/
.github
/
workflows
/
stale.yaml
Copy path
View runs
More file actions
More file actions
Latest commit
History
History
History
143 lines (128 loc) · 5.22 KB
Breadcrumbs
coder
/
.github
/
workflows
/
stale.yaml
Copy path
File metadata and controls
143 lines (128 loc) · 5.22 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name
:
Stale Issue, Branch and Old Workflows Cleanup
on
:
schedule
:
#
Every day at midnight
-
cron
:
"
0 0 * * *
"
workflow_dispatch
:
permissions
:
contents
:
read
jobs
:
issues
:
runs-on
:
ubuntu-latest
permissions
:
#
Needed to close issues.
issues
:
write
#
Needed to close PRs.
pull-requests
:
write
steps
:
-
name
:
Harden Runner
uses
:
step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c
#
v2.21.0
with
:
egress-policy
:
audit
-
name
:
stale
uses
:
actions/stale@4391f3da665fdf50b6810c1a66712fb9ba21aa93
#
v11.0.0
with
:
stale-issue-label
:
"
stale
"
stale-pr-label
:
"
stale
"
#
days-before-stale: 180
#
essentially disabled for now while we work through polish issues
days-before-stale
:
3650
#
Pull Requests become stale more quickly due to merge conflicts.
#
Also, we promote minimizing WIP.
days-before-pr-stale
:
7
days-before-pr-close
:
3
#
We rarely take action in response to the message, so avoid
#
cluttering the issue and just close the oldies.
stale-pr-message
:
"
"
stale-issue-message
:
"
"
#
Upped from 30 since we have a big tracker and was hitting the limit.
operations-per-run
:
60
#
Start with the oldest issues, always.
ascending
:
true
-
name
:
"
Close old issues labeled likely-no
"
uses
:
actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3
#
v9.0.0
with
:
github-token
:
${{ secrets.GITHUB_TOKEN }}
script
:
|
const thirtyDaysAgo = new Date(new Date().setDate(new Date().getDate() - 30));
console.log(`Looking for issues labeled with 'likely-no' more than 30 days ago, which is after ${thirtyDaysAgo.toISOString()}`);
const issues = await github.rest.issues.listForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
labels: 'likely-no',
state: 'open',
});
console.log(`Found ${issues.data.length} open issues labeled with 'likely-no'`);
for (const issue of issues.data) {
console.log(`Checking issue #${issue.number} created at ${issue.created_at}`);
const timeline = await github.rest.issues.listEventsForTimeline({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
});
const labelEvent = timeline.data.find(event => event.event === 'labeled' && event.label.name === 'likely-no');
if (labelEvent) {
console.log(`Issue #${issue.number} was labeled with 'likely-no' at ${labelEvent.created_at}`);
if (new Date(labelEvent.created_at) < thirtyDaysAgo) {
console.log(`Issue #${issue.number} is older than 30 days with 'likely-no' label, closing issue.`);
await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
state: 'closed',
state_reason: 'not_planned'
});
}
} else {
console.log(`Issue #${issue.number} does not have a 'likely-no' label event in its timeline.`);
}
}
branches
:
runs-on
:
ubuntu-latest
permissions
:
#
Needed to delete branches.
contents
:
write
steps
:
-
name
:
Harden Runner
uses
:
step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c
#
v2.21.0
with
:
egress-policy
:
audit
-
name
:
Checkout repository
uses
:
actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
#
v7.0.1
with
:
persist-credentials
:
false
-
name
:
Run delete-old-branches-action
uses
:
beatlabs/delete-old-branches-action@4eeeb8740ff8b3cb310296ddd6b43c3387734588
#
v0.0.11
with
:
repo_token
:
${{ github.token }}
date
:
"
6 months ago
"
dry_run
:
false
delete_tags
:
false
#
extra_protected_branch_regex: ^(foo|bar)$
exclude_open_pr_branches
:
true
del_runs
:
runs-on
:
ubuntu-latest
permissions
:
#
Needed to delete workflow runs.
actions
:
write
steps
:
-
name
:
Harden Runner
uses
:
step-security/harden-runner@05e31511f85b41b11d1cf0ef85d0992719546e2c
#
v2.21.0
with
:
egress-policy
:
audit
-
name
:
Delete PR Cleanup workflow runs
uses
:
Mattraks/delete-workflow-runs@b3018382ca039b53d238908238bd35d1fb14f8ee
#
v2.1.0
with
:
token
:
${{ github.token }}
repository
:
${{ github.repository }}
retain_days
:
30
keep_minimum_runs
:
30
delete_workflow_pattern
:
pr-cleanup.yaml
-
name
:
Delete PR Deploy workflow skipped runs
uses
:
Mattraks/delete-workflow-runs@b3018382ca039b53d238908238bd35d1fb14f8ee
#
v2.1.0
with
:
token
:
${{ github.token }}
repository
:
${{ github.repository }}
retain_days
:
30
keep_minimum_runs
:
30
delete_workflow_pattern
:
pr-deploy.yaml
Back
|
FazBrowse Home
|
New Git URL