Object order in triggering events #29
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Remove Workon Label | |
on: | |
issues: | |
types: [closed] | |
permissions: | |
issues: write | |
jobs: | |
remove_label: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Remove label | |
uses: actions/github-script@v7 | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
let req = { | |
issue_number: context.issue.number, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
}; | |
const labelToRemove = 'workon'; | |
const issue = await github.rest.issues.get(req); | |
const labels = issue.data.labels; | |
const hasLabel = labels.some(label => label.name === labelToRemove); | |
if (hasLabel) { | |
await github.rest.issues.removeLabel({...req, name: labelToRemove}); | |
} |