From dbe7bf43a93fc314af7ce8a4713465e2d8fc9990 Mon Sep 17 00:00:00 2001 From: "Eric T. Johnson" Date: Fri, 5 Apr 2024 19:12:37 -0400 Subject: [PATCH] Add CI test that fails if a PR is issued to main --- .github/workflows/check_pr_branch.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/check_pr_branch.yml diff --git a/.github/workflows/check_pr_branch.yml b/.github/workflows/check_pr_branch.yml new file mode 100644 index 0000000000..3543088221 --- /dev/null +++ b/.github/workflows/check_pr_branch.yml @@ -0,0 +1,20 @@ +name: check PR branch + +on: + pull_request: + types: + - opened + - synchronize + - reopened + - edited + +jobs: + check-PR-branch: + runs-on: ubuntu-latest + steps: + - name: PRs should not target main + run: | + if [[ "${{ github.base_ref }}" == "main" ]]; then + echo 'Pull requests must not be made against main. Please target development instead.' + exit 1 + fi