Skip to content

Commit

Permalink
Update remove-labels.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mechelon authored Oct 29, 2024
1 parent 020b405 commit fa0a3d9
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions .github/workflows/remove-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,26 @@ jobs:
const issue_num = context.issue.number;
const owner = context.repo.owner;
const repo = context.repo.repo;
const commentAuthor = context.payload.comment.user.login;
const issue = await github.rest.issues.get({
owner,
repo,
issue_number: issue_num
});
const labelsToRemove = ['needs more information', 'stale', 'Stale'];
for (const label of labelsToRemove) {
if (issue.data.labels.some(issueLabel => issueLabel.name === label)) {
await github.rest.issues.removeLabel({
issue_number: issue_num,
owner,
repo,
name: label
});
if (commentAuthor === issue.data.user.login) {
const labelsToRemove = ['needs more information', 'stale', 'Stale'];
for (const label of labelsToRemove) {
if (issue.data.labels.some(issueLabel => issueLabel.name === label)) {
await github.rest.issues.removeLabel({
issue_number: issue_num,
owner,
repo,
name: label
});
}
}
}

0 comments on commit fa0a3d9

Please sign in to comment.