name: Check pull request 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 }} != "devel" ] && [ ${{ github.base_ref }} == "master" ]; then
            echo "Merge requests to master branch are only allowed from devel branch."
            exit 1
          fi
