Skip to content
This repository was archived by the owner on Jul 20, 2026. It is now read-only.

supervisor and account info pages #20

supervisor and account info pages

supervisor and account info pages #20

name: Restrict merge source
on:
pull_request:
branches:
- main
- dev
- docs
jobs:
check-source-branch:
runs-on: ubuntu-latest
steps:
- name: Check that PR source is 'dev'
run: |
if [ "${{ github.base_ref }}" == "main" ]; then
if [ "${{ github.head_ref }}" != "dev" ] && [ "${{ github.head_ref }}" != "docs" ]; then
echo "PRs to master are only allowed from the 'dev' or 'docs' branch."
echo "Source branch was: ${{ github.head_ref }}"
exit 1
fi
fi
if [ "${{ github.base_ref }}" == "dev" ] && [ "${{ github.head_ref }}" == "main" ]; then
echo "Merges from 'main' to 'dev' are not allowed."
exit 1
fi
if [ "${{ github.base_ref }}" == "docs" ]; then
echo "No merges are allowed onto 'docs'."
exit 1
fi
if [ "${{ github.head_ref }}" == "docs" ] && [ "${{ github.base_ref }}" != "main" ]; then
echo "'docs' can only be merged into 'main'."
echo "Target branch was: ${{ github.base_ref }}"
exit 1
fi
echo "Source branch is allowed. Proceeding."