Skip to content

Commit 0e1eb96

Browse files
fix: get the tag when creating the gh release
1 parent 14cce80 commit 0e1eb96

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,16 @@ jobs:
1515
with:
1616
fetch-depth: 0 # make sure you have full history and tags
1717
- name: Checkout tag if available
18+
id: find_tag
1819
run: |
1920
TAG=$(git tag --points-at HEAD)
2021
if [ -n "$TAG" ]; then
2122
echo "Tag found: $TAG. Checking out tag..."
2223
git checkout "$TAG"
24+
echo "tag=$TAG" >> $GITHUB_OUTPUT
2325
else
2426
echo "No tag found on this commit."
27+
echo "tag=" >> $GITHUB_OUTPUT
2528
fi
2629
- name: Setup JDK
2730
uses: actions/setup-java@v4
@@ -44,6 +47,6 @@ jobs:
4447
env:
4548
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4649
with:
47-
tag_name: ${{ github.ref }}
48-
release_name: ${{ github.ref }}
49-
prerelease: ${{ contains(github.ref, 'beta') || contains(github.ref, 'rc') }}
50+
tag_name: ${{ steps.find_tag.outputs.tag }}
51+
release_name: ${{ steps.find_tag.outputs.tag }}
52+
prerelease: ${{ contains(steps.find_tag.outputs.tag, 'beta') || contains(steps.find_tag.outputs.tag, 'rc') }}

0 commit comments

Comments
 (0)