From 62f0a2a23842a8b0f02f3f0912ad524859518590 Mon Sep 17 00:00:00 2001 From: ashim-hq Date: Fri, 17 Apr 2026 00:21:55 +0800 Subject: [PATCH] chore: fall back to latest tag when semantic-release finds no new commits Allows re-triggering the release workflow after a Docker push failure without needing new commits. If semantic-release produces no new version the workflow now uses the latest existing git tag for the Docker build. --- .github/workflows/release.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e155c0a7..8234493c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,8 +45,17 @@ jobs: if [ -f .release-version ]; then echo "version=$(cat .release-version)" >> "$GITHUB_OUTPUT" else - echo "::error::semantic-release did not produce a new version. No releasable commits found." - exit 1 + # semantic-release found no new commits — tag already exists from a + # previous run. Fall back to the latest git tag so the Docker build + # jobs still run (useful when re-triggering after a push failure). + latest=$(git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//') + if [ -n "$latest" ]; then + echo "version=$latest" >> "$GITHUB_OUTPUT" + echo "Re-using existing tag v${latest} for Docker build." + else + echo "::error::semantic-release did not produce a new version. No releasable commits found." + exit 1 + fi fi docker: