Skip to content

Commit 14cce80

Browse files
fix: checkout tag if it exists
1 parent 85756f0 commit 14cce80

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

.github/workflows/release.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,17 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v4
15-
name: Checkout code
15+
with:
16+
fetch-depth: 0 # make sure you have full history and tags
17+
- name: Checkout tag if available
18+
run: |
19+
TAG=$(git tag --points-at HEAD)
20+
if [ -n "$TAG" ]; then
21+
echo "Tag found: $TAG. Checking out tag..."
22+
git checkout "$TAG"
23+
else
24+
echo "No tag found on this commit."
25+
fi
1626
- name: Setup JDK
1727
uses: actions/setup-java@v4
1828
with:

0 commit comments

Comments
 (0)