chore: sync development → beta #2
Workflow file for this run
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 | |
| 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" |