Skip to content

Commit

Permalink
fix stale label remover (#18026)
Browse files Browse the repository at this point in the history
  • Loading branch information
serenibyss authored Nov 18, 2024
1 parent 7457dad commit 3079dfb
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions .github/workflows/stale_remover.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,17 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: 'Status: Stale'
})
const labelToRemove = 'Status: Stale';
const issueLabels = context.payload.issue.labels.map(label => label.name);
if (issueLabels.includes(labelToRemove)) {
console.log(`Removing label: ${labelToRemove}`);
github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: 'Status: Stale'
});
} else {
console.log(`Label ${labelToRemove} is not present, skipping`);
}

0 comments on commit 3079dfb

Please sign in to comment.