Skip to content

Release: merge development into beta #11

Release: merge development into beta

Release: merge development into beta #11

name: Branch Protection
on:
pull_request:
branches:
- main
- beta
jobs:
check-branch:
runs-on: ubuntu-latest
# Observed fleet-wide: n=123 runs, max 0.1 min
timeout-minutes: 10
steps:
- name: Check branch
run: |
TARGET="${{ github.base_ref }}"
SOURCE="${{ github.head_ref }}"
if [[ "$TARGET" == "main" ]]; then
if [[ "$SOURCE" != "beta" ]] && ! [[ "$SOURCE" =~ ^hotfix ]]; then
echo "Error: Pull requests to main must come from 'beta' or a branch starting with 'hotfix'"
echo "Source branch: $SOURCE"
exit 1
fi
elif [[ "$TARGET" == "beta" ]]; then
if [[ "$SOURCE" != "development" ]] && ! [[ "$SOURCE" =~ ^hotfix ]]; then
echo "Error: Pull requests to beta must come from 'development' or a branch starting with 'hotfix'"
echo "Source branch: $SOURCE"
exit 1
fi
fi
echo "Branch check passed: $SOURCE -> $TARGET"