replicate content pages #39
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
# if the base_ref(target branch we want to merge to) is 'main' and the head_ref(source branch we want to merge from) is not 'release' | |
# Then throw an error, as only the release is allowed to merge into the 'main' branch | |
# Otherwise this action won't run and show as a success | |
name: 'Branch guard 🛡️' | |
on: | |
pull_request: | |
types: [opened, edited, synchronize] | |
jobs: | |
can-merge-to-branch: | |
name: Can merge to branch | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Checking if the branch is allowed... | |
if: "github.base_ref == 'main' && github.head_ref != 'release'" | |
run: | | |
echo ""; | |
echo "::error::Not allowed to merge '$GITHUB_HEAD_REF' branch into '$GITHUB_BASE_REF' branch"; | |
echo "---"; | |
exit 1; |