Release: merge development into beta #11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" |