Skip to content

Commit f3b9bd4

Browse files
authored
Update issue-labels.yml (#517)
1 parent 0d78eab commit f3b9bd4

File tree

1 file changed

+17
-23
lines changed

1 file changed

+17
-23
lines changed

.github/workflows/issue-labels.yml

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,30 @@ on:
44
issues:
55
types: [opened, reopened]
66

7+
env:
8+
TRIAGERS: '["karthiknadig","eleanorjboyd","anthonykim1"]'
9+
710
permissions:
811
issues: write
912

1013
jobs:
1114
# From https://github.com/marketplace/actions/github-script#apply-a-label-to-an-issue.
12-
add-triage-label:
13-
name: "Add 'triage-needed'"
15+
add-classify-label:
16+
name: "Add 'triage-needed' and remove assignees"
1417
runs-on: ubuntu-latest
1518
steps:
16-
- uses: actions/github-script@v7
19+
- name: Checkout Actions
20+
uses: actions/checkout@v4
1721
with:
18-
github-token: ${{ secrets.GITHUB_TOKEN }}
19-
script: |
20-
const result = await github.rest.issues.listLabelsOnIssue({
21-
owner: context.repo.owner,
22-
repo: context.repo.repo,
23-
issue_number: context.issue.number,
24-
})
25-
const labels = result.data.map((label) => label.name)
26-
const hasNeeds = labels.some((label) => label.startsWith('needs'))
22+
repository: 'microsoft/vscode-github-triage-actions'
23+
ref: stable
24+
path: ./actions
2725

28-
if (!hasNeeds) {
29-
console.log('This issue is not labeled with a "needs __" label, add the "triage-needed" label.')
26+
- name: Install Actions
27+
run: npm install --production --prefix ./actions
3028

31-
github.rest.issues.addLabels({
32-
owner: context.repo.owner,
33-
repo: context.repo.repo,
34-
issue_number: context.issue.number,
35-
labels: ['triage-needed']
36-
})
37-
} else {
38-
console.log('This issue already has a "needs __" label, do not add the "triage-needed" label.')
39-
}
29+
- name: "Add 'triage-needed' and remove assignees"
30+
uses: ./actions/python-issue-labels
31+
with:
32+
triagers: ${{ env.TRIAGERS }}
33+
token: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)