Skip to content

Commit 787f152

Browse files
authored
chore: Add triage workflow (#10315)
This adds a triage workflow for issues
1 parent cfd0379 commit 787f152

1 file changed

Lines changed: 52 additions & 0 deletions

File tree

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Request issue triage
2+
3+
on:
4+
issues:
5+
types: [labeled]
6+
7+
permissions: {}
8+
9+
jobs:
10+
dispatch:
11+
if: >-
12+
github.repository == 'npm/cli' &&
13+
github.event.label.name == 'Triage Requested'
14+
runs-on: ubuntu-latest
15+
timeout-minutes: 5
16+
17+
steps:
18+
- name: Create dispatcher token
19+
id: app
20+
uses: actions/create-github-app-token@v3
21+
with:
22+
client-id: ${{ vars.TRIAGE_APP_CLIENT_ID }}
23+
private-key: ${{ secrets.TRIAGE_APP_PRIVATE_KEY }}
24+
owner: npm
25+
repositories: triage
26+
permission-actions: write
27+
28+
- name: Dispatch private triage workflow
29+
shell: bash
30+
env:
31+
GH_TOKEN: ${{ steps.app.outputs.token }}
32+
SOURCE_REPOSITORY: ${{ github.repository }}
33+
ISSUE_NUMBER: ${{ github.event.issue.number }}
34+
REQUEST_ID: ${{ github.repository }}:${{ github.run_id }}:${{ github.run_attempt }}
35+
run: |
36+
jq -n \
37+
--arg repository "$SOURCE_REPOSITORY" \
38+
--arg issue "$ISSUE_NUMBER" \
39+
--arg request "$REQUEST_ID" \
40+
'{
41+
ref: "main",
42+
inputs: {
43+
source_repository: $repository,
44+
issue_number: $issue,
45+
immediate: true,
46+
request_id: $request
47+
}
48+
}' |
49+
gh api \
50+
--method POST \
51+
repos/npm/triage/actions/workflows/triage.yml/dispatches \
52+
--input -

0 commit comments

Comments
 (0)