|
4 | 4 | issues:
|
5 | 5 | types: [opened, reopened]
|
6 | 6 |
|
| 7 | +env: |
| 8 | + TRIAGERS: '["karthiknadig","eleanorjboyd","anthonykim1"]' |
| 9 | + |
7 | 10 | permissions:
|
8 | 11 | issues: write
|
9 | 12 |
|
10 | 13 | jobs:
|
11 | 14 | # 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" |
14 | 17 | runs-on: ubuntu-latest
|
15 | 18 | steps:
|
16 |
| - - uses: actions/github-script@v7 |
| 19 | + - name: Checkout Actions |
| 20 | + uses: actions/checkout@v4 |
17 | 21 | 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 |
27 | 25 |
|
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 |
30 | 28 |
|
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