From 3ecf9a20cdcc36cc6351b0859f81e368241d67d6 Mon Sep 17 00:00:00 2001 From: Robin Date: Tue, 4 Mar 2025 07:01:39 -0500 Subject: [PATCH] Prevent PRs with the X-Blocked label from being merged (#3864) Just a small CI suggestion: X-Blocked is useful for requesting review on a change while ensuring it won't be merged until all external dependencies are accounted for, and it'd be nice to have this enforced more consistently across the org. Adapted from matrix-js-sdk (https://github.com/matrix-org/matrix-js-sdk/blob/develop/.github/workflows/pull_request.yaml) --- .github/workflows/blocked.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/blocked.yml diff --git a/.github/workflows/blocked.yml b/.github/workflows/blocked.yml new file mode 100644 index 000000000..d6e592cb0 --- /dev/null +++ b/.github/workflows/blocked.yml @@ -0,0 +1,17 @@ +name: Prevent blocked +on: + pull_request: + types: [opened, labeled, unlabeled] +jobs: + prevent-blocked: + name: Prevent blocked + runs-on: ubuntu-latest + permissions: + pull-requests: read + steps: + - name: Add notice + uses: actions/github-script@v7 + if: contains(github.event.pull_request.labels.*.name, 'X-Blocked') + with: + script: | + core.setFailed("PR has been labeled with X-Blocked; it cannot be merged.");