Multi region auto switching support #3
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: Validate merge source OSS | |
| on: | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| check-source: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Enforce allowed source branches | |
| run: | | |
| BASE="${{ github.base_ref }}" # target branch | |
| HEAD="${{ github.head_ref }}" # source branch | |
| echo "PR: $HEAD -> $BASE" | |
| case "$BASE" in | |
| main) | |
| if [[ "$HEAD" =~ ^r/release\..* || "$HEAD" == "alpha" ]]; then | |
| echo "OK: $HEAD is allowed into main" | |
| else | |
| echo "::error::PRs into main must come from r/release.* or alpha (got '$HEAD')" | |
| exit 1 | |
| fi | |
| ;; | |
| alpha|integration) | |
| if [[ "$HEAD" =~ ^r/release\..* ]]; then | |
| echo "OK: $HEAD is allowed into $BASE" | |
| else | |
| echo "::error::PRs into $BASE must come from r/release.* (got '$HEAD')" | |
| exit 1 | |
| fi | |
| ;; | |
| *) | |
| echo "No source restriction configured for $BASE" | |
| ;; | |
| esac |