Ensure #945
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: Cleanup Triage Label | |
on: | |
issues: | |
types: [assigned] | |
permissions: | |
issues: write | |
jobs: | |
cleanup: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cleanup triage-needed label | |
run: | | |
ISSUE_NUMBER=${{ github.event.issue.number }} | |
ASSIGNER_TYPE=${{ github.event.assignee.type }} | |
REPONAME=${{ github.event.repository.full_name }} | |
LABELS=$(gh issue view $ISSUE_NUMBER --repo ${{ github.event.repository.full_name }} --json labels -q '.labels[].name') | |
if [[ $ASSIGNER_TYPE != "Bot" ]] && [[ $LABELS == *"triage-needed"* ]]; then | |
gh api --method DELETE -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/$REPONAME/issues/$ISSUE_NUMBER/labels/triage-needed | |
fi | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |