From 9e8d2e70bd6b3efefe929368afc4bb3be877941f Mon Sep 17 00:00:00 2001 From: Etan Kissling Date: Wed, 1 May 2024 21:30:03 +0200 Subject: [PATCH] block pull requests to `stable` (#6001) * block pull requests to `stable` Pull requests should be opened against the `unstable` branch. See https://nimbus.guide/contribute.html#build-and-deploy * avoid deleting branch to mimic manual close * avoid triggering on dependabot PRs --- .github/workflows/ci.yml | 2 ++ .github/workflows/pr_block.yml | 30 ++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 .github/workflows/pr_block.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6cbd43d88..cbc68378b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,6 +15,8 @@ on: - unstable pull_request: paths-ignore: ['media/**', 'docs/**', '**/*.md'] + branches-ignore: + - stable workflow_dispatch: concurrency: # Cancel stale PR builds (but not push builds) diff --git a/.github/workflows/pr_block.yml b/.github/workflows/pr_block.yml new file mode 100644 index 000000000..0c71f51c8 --- /dev/null +++ b/.github/workflows/pr_block.yml @@ -0,0 +1,30 @@ +# beacon_chain +# Copyright (c) 2024 Status Research & Development GmbH +# Licensed and distributed under either of +# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). +# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). +# at your option. This file may not be copied, modified, or distributed except according to those terms. + +name: PR block +on: + pull_request: + branches: + - stable + +jobs: + close: + name: "Close pull request" + runs-on: ubuntu-latest + if: github.actor != 'dependabot[bot]' + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Close + run: | + gh pr close ${{ github.event.pull_request.number }} --comment \ + 'Pull requests to the `stable` branch are not allowed. + Please open your pull request against the `unstable` branch. + See https://nimbus.guide/contribute.html#build-and-deploy' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}