DEV: Adds a GitHub workflow to check target branch (#24273)

* DEV: Adds a GitHub workflow to check target branch

Adds a GitHub workflow to check that the target branch for PRs in the
discourse-private-mirror repo aren't set to the tests-passed branch.

* Rename workflow
This commit is contained in:
Blake Erickson 2023-11-08 10:34:20 -07:00 committed by GitHub
parent 277496b6e0
commit 670692cfa9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 0 deletions

14
.github/workflows/check-branches.yml vendored Normal file
View File

@ -0,0 +1,14 @@
name: PR base branch check
on:
pull_request:
jobs:
check-branches:
if: github.event_name == 'pull_request' && github.repository == 'discourse/discourse-private-mirror'
runs-on: ubuntu-latest
steps:
- name: Check branches
run: |
if [ ${{ github.base_ref }} == "tests-passed" ]; then
echo "PR requests to tests-passed branch are not allowed. Please use main."
exit 1
fi