name: Make sure new PRs are sent to dev branch

on:
  pull_request_target:
    types: [opened, edited]

jobs:
  check-branch:
    runs-on: ubuntu-latest
    steps:
      - uses: Vankka/pr-target-branch-action@v2
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          target: "main prerelease"
          exclude: "dev prerelease"
          comment: |
              Your PR was set to target `main` or `prerelease`.
              PRs should be target `dev` instead.
