From ee25392f500257523688be7a28bf77a7105df3b2 Mon Sep 17 00:00:00 2001 From: shrimbly Date: Thu, 1 Jan 2026 21:16:47 +1300 Subject: [PATCH] github action to prevent PRs to master --- .github/workflows/block-master-prs.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/block-master-prs.yml diff --git a/.github/workflows/block-master-prs.yml b/.github/workflows/block-master-prs.yml new file mode 100644 index 00000000..32d3f1a8 --- /dev/null +++ b/.github/workflows/block-master-prs.yml @@ -0,0 +1,16 @@ +name: Enforce Develop Branch +on: + pull_request: + branches: + - master # Triggers only on PRs targeting master + +jobs: + guard-master: + runs-on: ubuntu-latest + steps: + - name: Check base branch + # logic: If the PR is NOT coming from a release or hotfix branch, block it. + if: "!startsWith(github.head_ref, 'release/') && !startsWith(github.head_ref, 'hotfix/')" + run: | + echo "::error::⛔ WRONG BRANCH: You are trying to merge into 'master'. Please change the base branch of this PR to 'develop'." + exit 1