VIDSOL-878: Bottom bar extensibility API #311
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: check-pull-request-base-branch | |
| on: | |
| pull_request: | |
| types: [edited, opened, reopened, synchronize] | |
| permissions: | |
| contents: read | |
| jobs: | |
| validate-base-branch: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check base branch | |
| env: | |
| BASE_BRANCH: ${{ github.base_ref }} | |
| HEAD_BRANCH: ${{ github.head_ref }} | |
| run: | | |
| # Check if head branch starts with 'release-' | |
| if [[ "$HEAD_BRANCH" == release-* ]]; then | |
| echo "Release branch detected: $HEAD_BRANCH" | |
| if [[ "$BASE_BRANCH" == "main" ]]; then | |
| echo "Release branch targeting main - VALID" | |
| exit 0 | |
| else | |
| echo "Release branches must target 'main', but found '$BASE_BRANCH'" | |
| exit 1 | |
| fi | |
| else | |
| # For non-release branches, base must be develop | |
| if [[ "$BASE_BRANCH" == "develop" ]]; then | |
| echo "Non-release branch targeting develop - VALID" | |
| exit 0 | |
| else | |
| echo "Non-release branches must target 'develop', but found '$BASE_BRANCH'" | |
| echo "Note: Only branches starting with 'release-' can target 'main'" | |
| exit 1 | |
| fi | |
| fi | |
| shell: bash |