Skip to content

Commit b39af3d

Browse files
authored
chore(ci): label mon maintainer issues for triage (#1102)
Signed-off-by: John Myers <9696606+johntmyers@users.noreply.github.com>
1 parent dd98eb2 commit b39af3d

2 files changed

Lines changed: 58 additions & 0 deletions

File tree

‎.github/workflows/issue-triage.yml‎

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,63 @@ permissions:
88
issues: write
99

1010
jobs:
11+
label-mon-maintainer-issues:
12+
runs-on: ubuntu-latest
13+
if: github.repository_owner == 'NVIDIA'
14+
env:
15+
ORG_READ_TOKEN: ${{ secrets.ORG_READ_TOKEN }}
16+
steps:
17+
- name: Require org read token
18+
if: env.ORG_READ_TOKEN == ''
19+
run: |
20+
echo "::error::ORG_READ_TOKEN is required to check mon-maintainers membership."
21+
exit 1
22+
23+
- name: Check mon-maintainers membership
24+
id: mon-maintainer
25+
uses: actions/github-script@v7
26+
with:
27+
github-token: ${{ secrets.ORG_READ_TOKEN }}
28+
result-encoding: string
29+
script: |
30+
const author = context.payload.issue.user.login;
31+
32+
try {
33+
const { data } = await github.rest.teams.getMembershipForUserInOrg({
34+
org: context.repo.owner,
35+
team_slug: 'mon-maintainers',
36+
username: author,
37+
});
38+
39+
if (data.state === 'active') {
40+
console.log(`${author} is an active mon-maintainers member.`);
41+
return 'true';
42+
}
43+
44+
console.log(`${author} has mon-maintainers membership state: ${data.state}`);
45+
} catch (e) {
46+
if (e.status === 404) {
47+
console.log(`${author} is not a mon-maintainers member.`);
48+
return 'false';
49+
}
50+
51+
throw e;
52+
}
53+
54+
return 'false';
55+
56+
- name: Add triage label
57+
if: steps.mon-maintainer.outputs.result == 'true'
58+
uses: actions/github-script@v7
59+
with:
60+
script: |
61+
await github.rest.issues.addLabels({
62+
owner: context.repo.owner,
63+
repo: context.repo.repo,
64+
issue_number: context.issue.number,
65+
labels: ['state:triage-needed'],
66+
});
67+
1168
check-agent-diagnostic:
1269
runs-on: ubuntu-latest
1370
# Only run on bug reports (title starts with "bug:")

‎CONTRIBUTING.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ Skills connect into pipelines. Individual skill files don't describe these relat
9292
- **Policy iteration:** `openshell-cli` → `generate-sandbox-policy`
9393

9494
Workflow state labels use the `state:*` prefix, and security work uses `topic:security`. GitHub issue templates assign built-in issue types where applicable, and agent-created issues should use issue types or manual follow-up rather than type labels.
95+
New issues opened by members of the `mon-maintainers` GitHub team are automatically labeled `state:triage-needed` by the issue triage workflow.
9596

9697
## Prerequisites
9798

0 commit comments

Comments
 (0)