Skip to content

Check PR Branch

Check PR Branch #1

name: Check PR Branch
run-name: Check PR Branch
on:
pull_request:
types: [opened, synchronize]
jobs:
Check-PR-Branch:
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
steps:
- name: Check Branch
run: |
if [[ ${{ github.ref }} != 'refs/heads/staging' && ${{ github.base_ref }} == 'refs/heads/main' ]]; then
echo "Pushing to main branch is not allowed."
exit 1
fi