7
7
issue_comment :
8
8
types : ["created"]
9
9
10
+ env :
11
+ # Name of the label that makes issues subject to the stale bot.
12
+ STALE_ENABLE_LABEL : " status: waiting for information"
13
+ # Name of the label used to mark issues as stale.
14
+ STALE_LABEL : " status: stale"
15
+
10
16
jobs :
11
17
stale-bot :
12
18
runs-on : ubuntu-latest
@@ -17,11 +23,11 @@ jobs:
17
23
with :
18
24
github-token : ${{github.token}}
19
25
script : |
20
- // Get a list of all open issues labeled ` waiting for feedback`
26
+ // Get a list of all open issues labeled as waiting for feedback
21
27
const opts = github.issues.listForRepo.endpoint.merge({
22
28
...context.repo,
23
29
state: 'open',
24
- labels: ['waiting for feedback '],
30
+ labels: ['${{ env.STALE_ENABLE_LABEL }} '],
25
31
});
26
32
const issues = await github.paginate(opts);
27
33
41
47
github.issues.addLabels({
42
48
...context.repo,
43
49
issue_number: issue.number,
44
- labels: ['stale ']
50
+ labels: ['${{ env.STALE_LABEL }} ']
45
51
});
46
52
}
47
53
52
58
github-token : ${{github.token}}
53
59
script : |
54
60
// Every time a comment is added to an issue, close it if it contains
55
- // the ` stale` label.
61
+ // the stale label.
56
62
57
63
// Load issue's labels.
58
64
const opts = github.issues.listLabelsOnIssue.endpoint.merge({
@@ -61,13 +67,13 @@ jobs:
61
67
});
62
68
const labels = await github.paginate(opts);
63
69
64
- // Search for ` stale` .
70
+ // Search for stale label .
65
71
for (const label of labels) {
66
- if (label.name === 'stale ') {
72
+ if (label.name === '${{ env.STALE_LABEL }} ') {
67
73
await github.issues.removeLabel({
68
74
...context.repo,
69
75
issue_number: context.issue.number,
70
- name: 'stale '
76
+ name: '${{ env.STALE_LABEL }} '
71
77
})
72
78
return;
73
79
}
@@ -79,11 +85,11 @@ jobs:
79
85
with :
80
86
github-token : ${{github.token}}
81
87
script : |
82
- // Load all the ` stale` issues
88
+ // Load all the stale issues
83
89
const opts = github.issues.listForRepo.endpoint.merge({
84
90
...context.repo,
85
91
state: 'open',
86
- labels: ['stale '],
92
+ labels: ['${{ env.STALE_LABEL }} '],
87
93
});
88
94
const issues = await github.paginate(opts);
89
95
0 commit comments