Add a Check Branch GH Action #3
This file contains 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' | |
on: | |
# Trigger the workflow on pull request, | |
# but only for the main branch | |
pull_request: | |
branches: | |
- main | |
jobs: | |
check_branch: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check branch | |
if: github.base_ref == 'main' && github.head_ref != 'dev' | |
run: | | |
echo "Base branch: ${{ github.base_ref }}" | |
echo "Head branch: ${{ github.head_ref }}" | |
# run: | | |
# echo "ERROR: You can only merge changes into main from the dev branch." | |
# exit 1 | |
# - name: Debugging Info |