if tag exists return tag

This commit is contained in:
2026-01-18 13:15:44 +01:00
parent 6400976d19
commit 99be386004

View File

@@ -38,6 +38,13 @@ runs:
id: bump id: bump
shell: bash shell: bash
run: | run: |
EXISTING_TAG="$(git tag --points-at HEAD "v*" | head -n 1)"
if [ -n "${EXISTING_TAG}" ]; then
echo "Tag ${EXISTING_TAG} already points at this commit; skipping bump."
echo "tag=${EXISTING_TAG}" >> "${GITHUB_OUTPUT}"
exit 0
fi
REF="${GITHUB_REF:-${GITEA_REF}}" REF="${GITHUB_REF:-${GITEA_REF}}"
BRANCH="${REF#refs/heads/}" BRANCH="${REF#refs/heads/}"
git fetch origin "${BRANCH}" --tags git fetch origin "${BRANCH}" --tags