mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
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.
This commit is contained in:
@@ -45,8 +45,17 @@ jobs:
|
|||||||
if [ -f .release-version ]; then
|
if [ -f .release-version ]; then
|
||||||
echo "version=$(cat .release-version)" >> "$GITHUB_OUTPUT"
|
echo "version=$(cat .release-version)" >> "$GITHUB_OUTPUT"
|
||||||
else
|
else
|
||||||
echo "::error::semantic-release did not produce a new version. No releasable commits found."
|
# semantic-release found no new commits — tag already exists from a
|
||||||
exit 1
|
# 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
|
fi
|
||||||
|
|
||||||
docker:
|
docker:
|
||||||
|
|||||||
Reference in New Issue
Block a user