mirror of
https://github.com/SwingTheVine/Wplace-BlueMarble.git
synced 2026-01-11 22:40:18 +00:00
Added workflow to check what branch PR came from
This commit is contained in:
parent
676bd85c6d
commit
dc99db309e
1 changed files with 18 additions and 0 deletions
18
.github/workflows/pr-branch-check.yml
vendored
Normal file
18
.github/workflows/pr-branch-check.yml
vendored
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
name: Enforce allowed branches for PRs to main
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
check-branch:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check PR source branch
|
||||
run: |
|
||||
echo "Source branch: ${{ github.head_ref }}"
|
||||
if [[ "${{ github.head_ref }}" != "documentation" && "${{ github.head_ref }}" != "code" ]]; then
|
||||
echo "Error: PRs to main must come from 'documentation' or 'code' branches only."
|
||||
exit 1
|
||||
fi
|
||||
Loading…
Reference in a new issue