From d57e90956fb115cf61bfb8566de5692d1e12d1c0 Mon Sep 17 00:00:00 2001 From: Diogo Trindade Date: Sun, 10 Sep 2023 15:19:12 +0100 Subject: [PATCH] CI - disallow PRs to master from any branch but dev --- .github/workflows/pr-branch.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/pr-branch.yml diff --git a/.github/workflows/pr-branch.yml b/.github/workflows/pr-branch.yml new file mode 100644 index 000000000..08ce8793d --- /dev/null +++ b/.github/workflows/pr-branch.yml @@ -0,0 +1,17 @@ +name: Check pull request branch +on: + pull_request_target: + types: + - opened + - reopened + - synchronize +jobs: + check-branches: + runs-on: ubuntu-latest + steps: + - name: Check branches + run: | + if [ ${{ github.head_ref }} != "development" ] && [ ${{ github.base_ref }} == "master" ]; then + echo "Merge requests to master are only allowed from development." + exit 1 + fi \ No newline at end of file