File tree 1 file changed +25
-3
lines changed
1 file changed +25
-3
lines changed Original file line number Diff line number Diff line change 15
15
- uses : actions/github-script@v7
16
16
with :
17
17
script : |
18
- github.rest.issues.addLabels ({
18
+ const issue = await github.rest.issues.get ({
19
19
issue_number: context.issue.number,
20
20
owner: context.repo.owner,
21
21
repo: context.repo.repo,
22
- labels: ['issue-status: needs-triage']
23
- })
22
+ });
23
+
24
+ const body = issue.data.body || '';
25
+
26
+ const osLabels = new Set(); // Use a Set to avoid duplicates
27
+
28
+ if (body.includes('Operating System: Darwin')) {
29
+ osLabels.add('os: macOS');
30
+ }
31
+
32
+ if (body.includes('Operating System: Linux')) {
33
+ osLabels.add('os: Linux');
34
+ }
35
+
36
+ if (body.includes('Operating System: Windows')) {
37
+ osLabels.add('os: Windows');
38
+ }
39
+
40
+ await github.rest.issues.addLabels({
41
+ issue_number: context.issue.number,
42
+ owner: context.repo.owner,
43
+ repo: context.repo.repo,
44
+ labels: ['issue-status: needs-triage', ...osLabels],
45
+ });
You can’t perform that action at this time.
0 commit comments