update builtin global metadata #2
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: Remove Labels on PR Update | |
on: | |
pull_request_target: | |
types: [synchronize] | |
jobs: | |
remove-labels: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '14' | |
- name: Remove all labels | |
run: | | |
PR_NUMBER="${{ github.event.pull_request.number }}" | |
LABELS=$(gh pr view "$PR_NUMBER" --json labels -q '.labels[].name') | |
echo $PR_NUMBER | |
echo $LABELS | |
if [ -n "$LABELS" ]; then | |
for label in $LABELS; do | |
gh pr edit "$PR_NUMBER" --remove-label "$label" | |
done | |
else | |
echo "No labels to remove." | |
fi | |
env: | |
GITHUB_TOKEN: ${{ secrets.PERSONAL_GITHUB_TOKEN }} |