Skip to content

Commit

Permalink
[core] Ensure at least one label exists on issues
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviertassinari committed Sep 2, 2023
1 parent 70e9eda commit 51a002b
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/ensure-triage-label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Ensure triage label is present

on:
label:
types:
- deleted
issues:
types:
- opened

permissions: {}

jobs:
label_issues:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6
with:
script: |
const { data: labels } = await github.rest.issues.listLabelsOnIssue({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
});
if (labels.length <= 0) {
await github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ['status: needs triage']
})
}

0 comments on commit 51a002b

Please sign in to comment.