From 5e044e06f0ac5c0f546c6013f0ae0fd3fd7c26f7 Mon Sep 17 00:00:00 2001 From: Matty Widdop <18513864+MattyTheHacker@users.noreply.github.com> Date: Tue, 15 Sep 2026 18:52:06 +0100 Subject: [PATCH 1/9] Add workflow to auto-remove committee review label --- .../workflows/auto-remove-review-label.yaml | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/auto-remove-review-label.yaml diff --git a/.github/workflows/auto-remove-review-label.yaml b/.github/workflows/auto-remove-review-label.yaml new file mode 100644 index 000000000..88d2ca1b1 --- /dev/null +++ b/.github/workflows/auto-remove-review-label.yaml @@ -0,0 +1,22 @@ +name: "Automatically remove committee review label from PRs" + +on: + pull_request: + types: + - closed + - converted_to_draft + +jobs: + labeler: + if: github.repository == 'CSSUoB/cssuob.github.io' && github.event.pull_request.user.type != 'Bot' + permissions: + pull-requests: write + + runs-on: ubuntu-latest + steps: + - name: Add "sync" label to PR + run: gh pr edit "$PR_URL" --remove-label sync --repo "$PR_REPO" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_URL: ${{ github.event.pull_request.html_url }} + PR_REPO: ${{ github.repository }} From 4b0a3c9e53d8785b5bc74e183f43fbabb306626f Mon Sep 17 00:00:00 2001 From: Matty Widdop <18513864+MattyTheHacker@users.noreply.github.com> Date: Tue, 15 Sep 2026 18:53:27 +0100 Subject: [PATCH 2/9] Fix label name --- .github/workflows/auto-remove-review-label.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-remove-review-label.yaml b/.github/workflows/auto-remove-review-label.yaml index 88d2ca1b1..079c3f921 100644 --- a/.github/workflows/auto-remove-review-label.yaml +++ b/.github/workflows/auto-remove-review-label.yaml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Add "sync" label to PR - run: gh pr edit "$PR_URL" --remove-label sync --repo "$PR_REPO" + run: gh pr edit "$PR_URL" --remove-label "awaiting committee review" --repo "$PR_REPO" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} PR_URL: ${{ github.event.pull_request.html_url }} From b5ebb2b8754a978f93b252eadc634e80af1e126b Mon Sep 17 00:00:00 2001 From: Matty Widdop <18513864+MattyTheHacker@users.noreply.github.com> Date: Tue, 15 Sep 2026 19:04:01 +0100 Subject: [PATCH 3/9] Fix workflow file --- .github/workflows/auto-remove-review-label.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/auto-remove-review-label.yaml b/.github/workflows/auto-remove-review-label.yaml index 079c3f921..b24ec0420 100644 --- a/.github/workflows/auto-remove-review-label.yaml +++ b/.github/workflows/auto-remove-review-label.yaml @@ -1,6 +1,6 @@ -name: "Automatically remove committee review label from PRs" +name: Automatically remove committee review label from PRs -on: +"on": pull_request: types: - closed @@ -15,8 +15,8 @@ jobs: runs-on: ubuntu-latest steps: - name: Add "sync" label to PR - run: gh pr edit "$PR_URL" --remove-label "awaiting committee review" --repo "$PR_REPO" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PR_URL: ${{ github.event.pull_request.html_url }} PR_REPO: ${{ github.repository }} + PR_URL: ${{ github.event.pull_request.html_url }} + run: gh pr edit "$PR_URL" --remove-label "awaiting committee review" --repo "$PR_REPO" From 7a106d430d767fbf7b9ff70423138a0a95e14baf Mon Sep 17 00:00:00 2001 From: Matty Widdop <18513864+MattyTheHacker@users.noreply.github.com> Date: Tue, 15 Sep 2026 19:25:03 +0100 Subject: [PATCH 4/9] Update .github/workflows/auto-remove-review-label.yaml Co-authored-by: Matt Norton Signed-off-by: Matty Widdop <18513864+MattyTheHacker@users.noreply.github.com> --- .github/workflows/auto-remove-review-label.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/auto-remove-review-label.yaml b/.github/workflows/auto-remove-review-label.yaml index b24ec0420..67d7b85d2 100644 --- a/.github/workflows/auto-remove-review-label.yaml +++ b/.github/workflows/auto-remove-review-label.yaml @@ -14,9 +14,9 @@ jobs: runs-on: ubuntu-latest steps: - - name: Add "sync" label to PR - env: + - env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} PR_REPO: ${{ github.repository }} PR_URL: ${{ github.event.pull_request.html_url }} + name: Add "sync" label to PR run: gh pr edit "$PR_URL" --remove-label "awaiting committee review" --repo "$PR_REPO" From 5046cd16a6582d52d6c570c7cbb0f18a245003a7 Mon Sep 17 00:00:00 2001 From: Matt Norton Date: Tue, 15 Sep 2026 19:33:01 +0100 Subject: [PATCH 5/9] Fix zizmor GitHub workflow suggestions --- .../workflows/auto-remove-review-label.yaml | 43 +++++++++++-------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/.github/workflows/auto-remove-review-label.yaml b/.github/workflows/auto-remove-review-label.yaml index 67d7b85d2..e909ae698 100644 --- a/.github/workflows/auto-remove-review-label.yaml +++ b/.github/workflows/auto-remove-review-label.yaml @@ -1,22 +1,31 @@ -name: Automatically remove committee review label from PRs +name: Automatically remove committee review label from closed PRs "on": - pull_request: - types: - - closed - - converted_to_draft + pull_request: + types: + - closed + - converted_to_draft + +concurrency: # yamllint disable-line rule:key-ordering + cancel-in-progress: true + group: ${{github.workflow}}-${{github.event.pull_request.number}} + +permissions: + contents: read jobs: - labeler: - if: github.repository == 'CSSUoB/cssuob.github.io' && github.event.pull_request.user.type != 'Bot' - permissions: - pull-requests: write + labeler: + if: github.repository == 'CSSUoB/TeX-Bot-Py-V2' && github.event.pull_request.user.type != + 'Bot' + name: Remove committee review label from closed PR + permissions: + pull-requests: write # Needed to remove the label - runs-on: ubuntu-latest - steps: - - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PR_REPO: ${{ github.repository }} - PR_URL: ${{ github.event.pull_request.html_url }} - name: Add "sync" label to PR - run: gh pr edit "$PR_URL" --remove-label "awaiting committee review" --repo "$PR_REPO" + runs-on: ubuntu-latest + steps: + - env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_REPO: ${{ github.repository }} + PR_URL: ${{ github.event.pull_request.html_url }} + name: Add "sync" label to PR + run: gh pr edit "$PR_URL" --remove-label "awaiting committee review" --repo "$PR_REPO" From e6d302e57fb9444e94682c7259ab8ff47f50f8c0 Mon Sep 17 00:00:00 2001 From: Matty Widdop <18513864+MattyTheHacker@users.noreply.github.com> Date: Tue, 15 Sep 2026 19:48:06 +0100 Subject: [PATCH 6/9] Fix condition for label removal in workflow Signed-off-by: Matty Widdop <18513864+MattyTheHacker@users.noreply.github.com> --- .github/workflows/auto-remove-review-label.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-remove-review-label.yaml b/.github/workflows/auto-remove-review-label.yaml index e909ae698..1768158d4 100644 --- a/.github/workflows/auto-remove-review-label.yaml +++ b/.github/workflows/auto-remove-review-label.yaml @@ -15,7 +15,7 @@ permissions: jobs: labeler: - if: github.repository == 'CSSUoB/TeX-Bot-Py-V2' && github.event.pull_request.user.type != + 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 permissions: From 79193896c47ad76a08971ad4a9c0b4fdea2cc641 Mon Sep 17 00:00:00 2001 From: Matty Widdop <18513864+MattyTheHacker@users.noreply.github.com> Date: Tue, 15 Sep 2026 19:52:23 +0100 Subject: [PATCH 7/9] Fix conditional formatting in workflow YAML Signed-off-by: Matty Widdop <18513864+MattyTheHacker@users.noreply.github.com> --- .github/workflows/auto-remove-review-label.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/auto-remove-review-label.yaml b/.github/workflows/auto-remove-review-label.yaml index 1768158d4..0e2f3a490 100644 --- a/.github/workflows/auto-remove-review-label.yaml +++ b/.github/workflows/auto-remove-review-label.yaml @@ -15,8 +15,7 @@ permissions: jobs: labeler: - if: github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.user.type != - 'Bot' + 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 permissions: pull-requests: write # Needed to remove the label From 6952720641d177836cde68e0ab731534466fb442 Mon Sep 17 00:00:00 2001 From: Matt Norton Date: Tue, 15 Sep 2026 20:18:37 +0100 Subject: [PATCH 8/9] Fix yamlfmt formatting --- .github/workflows/auto-remove-review-label.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/auto-remove-review-label.yaml b/.github/workflows/auto-remove-review-label.yaml index 0e2f3a490..9c96c0702 100644 --- a/.github/workflows/auto-remove-review-label.yaml +++ b/.github/workflows/auto-remove-review-label.yaml @@ -15,7 +15,8 @@ permissions: jobs: labeler: - if: github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.user.type != 'Bot' + 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 permissions: pull-requests: write # Needed to remove the label From 12bad4d359a414b52e5ae5fe31d35d1b7315df07 Mon Sep 17 00:00:00 2001 From: Matty Widdop <18513864+MattyTheHacker@users.noreply.github.com> Date: Tue, 15 Sep 2026 21:44:16 +0100 Subject: [PATCH 9/9] Change label action from adding to removing Signed-off-by: Matty Widdop <18513864+MattyTheHacker@users.noreply.github.com> --- .github/workflows/auto-remove-review-label.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/auto-remove-review-label.yaml b/.github/workflows/auto-remove-review-label.yaml index 9c96c0702..7d04624b9 100644 --- a/.github/workflows/auto-remove-review-label.yaml +++ b/.github/workflows/auto-remove-review-label.yaml @@ -27,5 +27,5 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} PR_REPO: ${{ github.repository }} PR_URL: ${{ github.event.pull_request.html_url }} - name: Add "sync" label to PR + name: Remove committee review label from closed PR run: gh pr edit "$PR_URL" --remove-label "awaiting committee review" --repo "$PR_REPO"