ci: removing all existing labels #197
Workflow file for this run
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: Update PR Label to Closed | |
on: | |
pull_request: | |
types: | |
- closed | |
jobs: | |
pr-label: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Remove all labels | |
run: | | |
PR_NUMBER=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH") | |
TOKEN=$GITHUB_TOKEN | |
# Add your repository name if it's not the default branch | |
REPO_NAME=$GITHUB_REPOSITORY | |
curl -L \ | |
-X DELETE \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
https://api.github.com/repos/${GITHUB_REPOSITORY}/issues/${PR_NUMBER}/labels | |
- name: Add new label | |
run: | | |
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }} | |
gh pr edit ${{ github.event.pull_request.number }} --add-label "Closed" |