Skip to content

Commit 58a59f2

Browse files
anaibertaBeta Bot
authored andcommitted
Cherry pick branch 'genexuslabs:feat/add-default-branch-check' into beta
1 parent 3945f18 commit 58a59f2

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

.github/workflows/create-release-branch.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@ jobs:
2626
name: Validate permissions
2727
runs-on: ubuntu-latest
2828
steps:
29+
- name: Check default branch
30+
env:
31+
REF: ${{ github.ref_name }}
32+
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
33+
run: |
34+
if [ "$REF" != "$DEFAULT_BRANCH" ]; then
35+
echo "::error::This workflow can only be run from the default branch (${DEFAULT_BRANCH}), but was triggered from '${REF}'."
36+
exit 1
37+
fi
38+
2939
- name: Check admin permission
3040
env:
3141
GH_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)