From 771397389c6490e21508c0c2afbe2a3fdeac8e53 Mon Sep 17 00:00:00 2001 From: Robin Date: Wed, 5 Mar 2025 05:44:10 -0500 Subject: [PATCH] Prevent PRs with the X-Blocked label from being merged (#3041) Copied from matrix-js-sdk (https://github.com/matrix-org/matrix-js-sdk/blob/develop/.github/workflows/pull_request.yaml#L31) --- .github/workflows/blocked.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/blocked.yaml diff --git a/.github/workflows/blocked.yaml b/.github/workflows/blocked.yaml new file mode 100644 index 00000000..d6e592cb --- /dev/null +++ b/.github/workflows/blocked.yaml @@ -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.");