diff --git a/.github/workflows/Check pull request source branch.yml b/.github/workflows/Check pull request source branch.yml new file mode 100644 index 0000000..84e10a3 --- /dev/null +++ b/.github/workflows/Check pull request source branch.yml @@ -0,0 +1,18 @@ +name: Check pull request source branch +on: + pull_request_target: + types: + - opened + - reopened + - synchronize + - edited +jobs: + check-branches: + runs-on: ubuntu-latest + steps: + - name: Check branches + run: | + if [ ${{ github.head_ref }} != "develop" ] && [ ${{ github.base_ref }} == "main" ]; then + echo "Merge requests to main branch are only allowed from dev branch." + exit 1 + fi