Stop labeling reopened triaged issues as 'needs triage' (#63615)

Release Notes:

- N/A
This commit is contained in:
Lena authored and GitHub committed 2026-09-02 11:30:46 +00:00
1 parent 97b1e64a17
commit d56dca8084
1 file changed
+16 -4
+16 -4
View File
@@ -57,15 +57,27 @@ jobs:
github-token: ${{ steps.get-app-token.outputs.token }}
script: |
const issue = context.payload.issue;
const hasTriageLabel = issue.labels.some(
label => label.name === 'state:needs triage'
);
const labelNames = issue.labels.map(label => label.name);
if (hasTriageLabel) {
if (labelNames.includes('state:needs triage')) {
console.log('Issue already has state:needs triage, skipping');
return;
}
if (context.payload.action === 'reopened') {
const requiredPrefixes = ['area:', 'reach:', 'severity:'];
const alreadyTriaged = requiredPrefixes.every(
prefix => labelNames.some(name => name.startsWith(prefix))
);
if (alreadyTriaged) {
console.log(
`Reopened issue #${issue.number} already has area:, reach: and severity: labels, skipping`
);
return;
}
}
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,