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