File tree Expand file tree Collapse file tree 1 file changed +23
-12
lines changed
Expand file tree Collapse file tree 1 file changed +23
-12
lines changed Original file line number Diff line number Diff line change 1- name : Label issues
1+ name : Add Triage Label
2+
23on :
34 issues :
4- types :
5- - reopened
6- - opened
5+ types : [opened]
6+
77jobs :
8- label_issues :
8+ triage :
99 runs-on : ubuntu-latest
10- permissions :
11- issues : write
1210 steps :
13- - run : gh issue edit "$NUMBER" --add-label "triage"
14- env :
15- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
16- GH_REPO : ${{ github.repository }}
17- NUMBER : ${{ github.event.issue.number }}
11+ - name : Check for existing labels
12+ id : check_labels
13+ uses : actions/github-script@v6
14+ with :
15+ script : |
16+ const labels = await github.issues.listLabelsOnIssue({
17+ owner: context.repo.owner,
18+ repo: context.repo.repo,
19+ issue_number: context.issue.number
20+ });
21+ return labels.data.length > 0;
22+
23+ - name : Add Triage Label
24+ if : steps.check_labels.outputs.result == 'false'
25+ uses : actions-ecosystem/action-add-labels@v1
26+ with :
27+ github_token : ${{ secrets.GITHUB_TOKEN }}
28+ labels : triage
You can’t perform that action at this time.
0 commit comments