Skip to content
This repository has been archived by the owner on Oct 13, 2024. It is now read-only.

Commit

Permalink
fix: more fixes for relabel workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ReenigneArcher committed Jan 4, 2024
1 parent 230178a commit cf6540c
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/Relabel_issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ jobs:
relabel_issue:
name: Relabel issue ${{ github.event.issue.number }}
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ github.token }}

steps:
- name: Relabel issue ${{ github.event.issue.number }}
Expand All @@ -31,14 +29,14 @@ jobs:
const labels_remove = ["approve-theme", "approve-queue"]
// check if labels list contains any of the labels to remove
for (var label of labels_remove) {
const label_remove = labels.data.some(label => label.name === label)
for (var label_name of labels_remove) {
var label_remove = labels.data.some(label => label.name === label_name)
if (label_remove) {
github.rest.issues.removeLabel({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
name: [label]
name: [label_name]
})
}
}
Expand All @@ -57,7 +55,10 @@ jobs:
})
}
// add label if it existed before
// add a delay to allow the label to be removed before trying to re-add it
await new Promise(r => setTimeout(r, 10000));
// add label if it existed before, this will re-trigger another workflow
if (label_request) {
github.rest.issues.addLabels({
issue_number: context.issue.number,
Expand Down

0 comments on commit cf6540c

Please sign in to comment.