Skip to content

Final files

Final files #6

name: Restrict PRs to main
on:
pull_request:
branches:
- main
jobs:
restrict-pr:
runs-on: ubuntu-latest
steps:
- name: Check if source branch is allowed
run: |
ALLOWED_BRANCHES=("testing")
SOURCE_BRANCH=$(echo "${{ github.event.pull_request.head.ref }}")
if [[ ! " ${ALLOWED_BRANCHES[@]} " =~ " ${SOURCE_BRANCH} " ]]; then
echo "Pull requests to 'main' can only come from 'testing'."
exit 1
fi