Skip to content

replicate content pages #39

replicate content pages

replicate content pages #39

Workflow file for this run

# 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;