Skip to content

feat: sd 259470

feat: sd 259470 #428

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)
# Then throw an error, as only next-release is allowed to merge into main
# Otherwise this action won't run and show as 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 branch is allowed...
if: "github.base_ref == 'main' && github.head_ref != 'next-release'"
run: |
echo "";
echo "::error::Not allowed to merge '$GITHUB_HEAD_REF' branch into '$GITHUB_BASE_REF' branch";
echo "---";
exit 1;