File tree 2 files changed +43
-1
lines changed
2 files changed +43
-1
lines changed Original file line number Diff line number Diff line change
1
+ #
2
+ # auto-label.yml
3
+ # - Find all open issues without a label and a title containing "[BUG]".
4
+ # - Apply the label "Bug: Potential ?" to these issues.
5
+ #
6
+
7
+ on :
8
+ schedule :
9
+ - cron : " 30 8 * * *"
10
+
11
+ jobs :
12
+ autolabel :
13
+ name : Auto Label
14
+ if : github.repository == 'MarlinFirmware/Marlin'
15
+ runs-on : ubuntu-latest
16
+ steps :
17
+ - name : Auto Label for [BUG]
18
+ uses : actions/github-script@v5
19
+ with :
20
+ script : |
21
+ # Get all open issues in this repository
22
+ const issueList = await github.rest.issues.listForRepo({
23
+ owner: context.repo.owner,
24
+ repo: context.repo.repo,
25
+ state: 'open'
26
+ });
27
+ # Filter the list of issues to only those that don't have any labels
28
+ # and have a title that contains '[BUG]'. Only the first 50 issues.
29
+ const matchingIssues = issueList.data.filter(
30
+ issue => issue.title.includes('[BUG]') && issue.labels.length === 0
31
+ );
32
+ # Process the first 50
33
+ for (const issue of matchingIssues.slice(0, 50)) {
34
+ // Run the desired action on the issue
35
+ // For example, to add a label:
36
+ await github.rest.issues.addLabels({
37
+ owner: context.repo.owner,
38
+ repo: context.repo.repo,
39
+ issue_number: issue.number,
40
+ labels: ['Bug: Potential ?']
41
+ });
42
+ }
Original file line number Diff line number Diff line change 17
17
runs-on : ubuntu-latest
18
18
19
19
steps :
20
- - uses : actions/stale@v3
20
+ - uses : actions/stale@v8
21
21
with :
22
22
repo-token : ${{ secrets.GITHUB_TOKEN }}
23
23
stale-issue-message : |
You can’t perform that action at this time.
0 commit comments