From db548743754512fb96bfcc51bf8e9e8c6978bb88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nandy=20B=C3=A2?= Date: Sat, 21 Dec 2024 15:16:42 +0100 Subject: [PATCH] feat: add workflow to restrict merges to master (#108) --- .github/workflows/branch-check-master.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/branch-check-master.yml diff --git a/.github/workflows/branch-check-master.yml b/.github/workflows/branch-check-master.yml new file mode 100644 index 0000000..92d2ad8 --- /dev/null +++ b/.github/workflows/branch-check-master.yml @@ -0,0 +1,17 @@ +name: Restrict merges to master + +on: + pull_request: + branches: + - master + +jobs: + check-branch-master: + runs-on: ubuntu-latest + steps: + - name: Check if the source branch is preprod + run: | + if [ "${{ github.event.pull_request.head.ref }}" != "preprod" ]; then + echo "Pull requests to master must come from preprod branch." + exit 1 + fi