From 14cce80c104b8da4c874c7a08366ff9fd97e89e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gast=C3=B3n=20Fournier?= Date: Thu, 16 Jan 2025 14:19:29 +0100 Subject: [PATCH] fix: checkout tag if it exists --- .github/workflows/release.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f442e18..b2ecce6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,7 +12,17 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Checkout code + with: + fetch-depth: 0 # make sure you have full history and tags + - name: Checkout tag if available + run: | + TAG=$(git tag --points-at HEAD) + if [ -n "$TAG" ]; then + echo "Tag found: $TAG. Checking out tag..." + git checkout "$TAG" + else + echo "No tag found on this commit." + fi - name: Setup JDK uses: actions/setup-java@v4 with: