Skip to content

Commit cfcc647

Browse files
Run release only on main branch
1 parent 11441eb commit cfcc647

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

.github/workflows/create-github-release.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,27 @@ on:
66
- "v*.*.*" # triggers on tags like vX.Y.Z
77

88
jobs:
9+
10+
run-only-on-main-branch:
11+
name: Create GitHub Release
12+
runs-on: ubuntu-latest
13+
needs: build-native
14+
permissions:
15+
contents: write
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
- name: Check if tag is on main
21+
run: |
22+
git fetch origin main
23+
if git merge-base --is-ancestor $GITHUB_SHA origin/main; then
24+
echo "Tag is on main"
25+
else
26+
echo "Tag is NOT on main, skipping"
27+
exit 0
28+
fi
29+
930
build-native:
1031
name: Build on ${{ matrix.os }}
1132
runs-on: ${{ matrix.os }}

0 commit comments

Comments
 (0)