yuramanga.my.id #889
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 'Needs more info' labels on issue closed | |
on: | |
issues: | |
types: [closed] | |
jobs: | |
remove_label: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/github-script@v3 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
var owner = context.repo.owner; | |
var repo = context.repo.repo; | |
var issue_number = context.issue.number; | |
var needsMoreInfo = 'needs-more-info'; | |
var issueLabelsRaw = await github.issues.listLabelsOnIssue({ | |
owner, | |
repo, | |
issue_number, | |
}); | |
var issueLabels = issueLabelsRaw.data | |
.map((el) => el.name); | |
if (issueLabels.indexOf(needsMoreInfo) > -1) { | |
github.issues.removeLabel({ | |
owner, | |
repo, | |
issue_number, | |
name: needsMoreInfo, | |
}); | |
} |