Skip to content

Commit 06da697

Browse files
committed
Add restriction to only create release on main branch
1 parent b64adef commit 06da697

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

.github/workflows/release.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ jobs:
3434
java-version: '17'
3535
distribution: 'temurin'
3636

37+
- name: Fail if Release and not on Default branch
38+
if: ${{ github.event.repository.default_branch != github.ref_name }}
39+
uses: actions/github-script@v7
40+
with:
41+
script: |
42+
core.setFailed('Releases can not be created on a feature branch. Branch: ${{ github.ref_name }}')
43+
3744
- name: Update Git user
3845
run: |
3946
git config --local user.name "IABTechLab"

0 commit comments

Comments
 (0)