Fixed Permissions. Generating, pruning and checking #23
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 branch hierarchy | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
check-source-branch: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fail if a PR to main is not coming from dev | |
if: ${{ github.event.pull_request.base.ref == 'main' && github.event.pull_request.head.ref != 'dev' }} | |
run: | | |
echo "This PR to 'main' is not coming from the 'dev' branch, fail" | |
exit 1 # Exit with non-zero status to make the check fail | |
- name: Pass if a PR to main is coming from dev | |
if: ${{ github.event.pull_request.base.ref == 'main' && github.event.pull_request.head.ref == 'dev' }} | |
run: | | |
echo "This PR to 'main' is coming from the 'dev' branch, pass." | |