File tree 1 file changed +24
-3
lines changed
1 file changed +24
-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
+ owner: context.repo.owner,
20
+ repo: context.repo.repo,
21
+ issue_number: context.issue.number
22
+ });
23
+
24
+ const body = issue.data.body || '';
25
+
26
+ const osLabels = [];
27
+ if (body.includes('Operating System: Darwin')) {
28
+ osLabels.push('os: macOS');
29
+ }
30
+
31
+ if (body.includes('Operating System: Linux')) {
32
+ osLabels.push('os: Linux');
33
+ }
34
+
35
+ if (body.includes('Operating System: Windows')) {
36
+ osLabels.push('os: Windows');
37
+ }
38
+
39
+ await github.rest.issues.addLabels({
19
40
issue_number: context.issue.number,
20
41
owner: context.repo.owner,
21
42
repo: context.repo.repo,
22
- labels: ['issue-status: needs-triage']
23
- })
43
+ labels: ['issue-status: needs-triage', ...osLabels ]
44
+ });
You can’t perform that action at this time.
0 commit comments