diff --git a/.gitea/workflows/deploy-to-test.yml b/.gitea/workflows/deploy-to-test.yml index fdc7b425..a9aedfd9 100644 --- a/.gitea/workflows/deploy-to-test.yml +++ b/.gitea/workflows/deploy-to-test.yml @@ -51,7 +51,14 @@ jobs: # Bump the patch version number. This creates a new commit and a new tag. # The commit message includes [skip ci] to prevent this push from triggering another workflow run. - npm version patch -m "ci: Bump version to %s [skip ci]" + # If the tag already exists (e.g. re-running a failed job), we skip the conflicting version. + if ! npm version patch -m "ci: Bump version to %s [skip ci]"; then + echo "⚠️ Version bump failed (likely tag exists). Attempting to skip to next version..." + # Bump package.json to the conflicting version without git tagging + npm version patch --no-git-tag-version > /dev/null + # Bump again to the next version, forcing it because the directory is now dirty + npm version patch -m "ci: Bump version to %s [skip ci]" --force + fi # Push the new commit and the new tag back to the main branch. git push --follow-tags