Skip to content

Commit

Permalink
Only add "status: new" label for issues without another status label
Browse files Browse the repository at this point in the history
  • Loading branch information
marcphilipp committed Oct 4, 2024
1 parent 5edbcbe commit 6bc20af
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/label-opened-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,18 @@ jobs:
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
with:
script: |
github.rest.issues.addLabels({
const issue = await github.rest.issues.get({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ["status: new"]
})
});
const originalLabels = issue.data.labels.map(l => l.name);
const statusLabels = originalLabels.filter(l => l.startsWith("status: "));
if (statusLabels.length === 0) {
github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: ["status: new"]
})
}

0 comments on commit 6bc20af

Please sign in to comment.