only update labels on accepted RFCs

This commit is contained in:
Lorenzo Manacorda 2024-10-29 11:31:41 +01:00
parent cf925c9e3c
commit a9afb898d9

View file

@ -16,14 +16,14 @@ jobs:
- run: nix-env -iA nixpkgs.github-cli - run: nix-env -iA nixpkgs.github-cli
- name: Update PR Labels - name: Update labels on accepted RFCs
env: env:
GH_TOKEN: ${{ github.token }} GH_TOKEN: ${{ github.token }}
PR_NUMBER: ${{ github.event.pull_request.number }} PR_NUMBER: ${{ github.event.pull_request.number }}
REPO: ${{ github.repository }} REPO: ${{ github.repository }}
run: | run: |
# Remove `status: accepted` label, if present # Only operate on PR if it has the `status: accepted` label
gh pr edit $PR_NUMBER --remove-label "status: accepted" --repo $REPO || true if gh pr view $PR_NUMBER --repo $REPO --json labels -q 'any(.[].name == "status: accepted")'; then
gh pr edit $PR_NUMBER --remove-label "status: accepted" --repo $REPO
# Add `status: merged` label gh pr edit $PR_NUMBER --add-label "status: merged" --repo $REPO
gh pr edit $PR_NUMBER --add-label "status: merged" --repo $REPO fi