From 3922bc11fa5d1720d18580a2b05da5fb39488921 Mon Sep 17 00:00:00 2001 From: Matt Norton Date: Mon, 30 Nov 2026 21:30:49 +0000 Subject: [PATCH 1/2] Expand auto-removal of PR lifecycle labels The additional lifecycle labels `sync` & `conflict` will be removed if the PR is closed/merged, along with the existing removal of the `awaiting committee review` label. If the PR is set back to draft only the `awaiting committee review` label is removed Signed-off-by: Matt Norton --- ...l => auto-remove-pr-lifecycle-labels.yaml} | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) rename .github/workflows/{auto-remove-review-label.yaml => auto-remove-pr-lifecycle-labels.yaml} (52%) diff --git a/.github/workflows/auto-remove-review-label.yaml b/.github/workflows/auto-remove-pr-lifecycle-labels.yaml similarity index 52% rename from .github/workflows/auto-remove-review-label.yaml rename to .github/workflows/auto-remove-pr-lifecycle-labels.yaml index 7d04624b9..8d2d4fd8d 100644 --- a/.github/workflows/auto-remove-review-label.yaml +++ b/.github/workflows/auto-remove-pr-lifecycle-labels.yaml @@ -1,4 +1,4 @@ -name: Automatically remove committee review label from closed PRs +name: Automatically remove lifecycle labels from closed PRs "on": pull_request: @@ -17,15 +17,29 @@ jobs: labeler: if: github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.user.type != 'Bot' - name: Remove committee review label from closed PR + name: Remove lifecycle labels from closed PR permissions: pull-requests: write # Needed to remove the label runs-on: ubuntu-latest steps: - env: + EVENT_ACTION: ${{ github.event.action }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} PR_REPO: ${{ github.repository }} PR_URL: ${{ github.event.pull_request.html_url }} - name: Remove committee review label from closed PR - run: gh pr edit "$PR_URL" --remove-label "awaiting committee review" --repo "$PR_REPO" + name: Remove lifecycle labels from closed PR + run: | + set -euo pipefail + + labels=("awaiting committee review") + if [ "$EVENT_ACTION" = "closed" ]; then + labels+=("sync" "conflict") + fi + + args=() + for label in "${labels[@]}"; do + args+=(--remove-label "$label") + done + + gh pr edit "$PR_URL" "${args[@]}" --repo "$PR_REPO" From 12ed0cc15d15878d254b33c4f714e105980cfb8c Mon Sep 17 00:00:00 2001 From: Matt Norton Date: Mon, 30 Nov 2026 22:12:01 +0000 Subject: [PATCH 2/2] Fix yamlfmt error --- .../auto-remove-pr-lifecycle-labels.yaml | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/auto-remove-pr-lifecycle-labels.yaml b/.github/workflows/auto-remove-pr-lifecycle-labels.yaml index 8d2d4fd8d..de8a8a20b 100644 --- a/.github/workflows/auto-remove-pr-lifecycle-labels.yaml +++ b/.github/workflows/auto-remove-pr-lifecycle-labels.yaml @@ -29,17 +29,17 @@ jobs: PR_REPO: ${{ github.repository }} PR_URL: ${{ github.event.pull_request.html_url }} name: Remove lifecycle labels from closed PR - run: | - set -euo pipefail + run: |- + set -euo pipefail - labels=("awaiting committee review") - if [ "$EVENT_ACTION" = "closed" ]; then - labels+=("sync" "conflict") - fi + labels=("awaiting committee review") + if [ "$EVENT_ACTION" = "closed" ]; then + labels+=("sync" "conflict") + fi - args=() - for label in "${labels[@]}"; do - args+=(--remove-label "$label") - done + args=() + for label in "${labels[@]}"; do + args+=(--remove-label "$label") + done - gh pr edit "$PR_URL" "${args[@]}" --repo "$PR_REPO" + gh pr edit "$PR_URL" "${args[@]}" --repo "$PR_REPO"