From 14301586e0825a96117ddf184a752d94dbc7f27c Mon Sep 17 00:00:00 2001 From: gffranco Date: Wed, 24 Jun 2026 01:43:28 +0000 Subject: [PATCH] fix(release): skip tag push when version stamp produced no changes --- .gitea/workflows/release.yaml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml index cf77b88..8a7e6cd 100644 --- a/.gitea/workflows/release.yaml +++ b/.gitea/workflows/release.yaml @@ -103,10 +103,18 @@ jobs: git config user.email "gitea-actions@users.noreply.code.gfran.co" git add Cargo.toml Cargo.lock \ crates/nuwiki-lsp/Cargo.toml crates/nuwiki-ls/Cargo.toml - git commit -m "chore(release): $VER" - git tag -a "$TAG" -m "nuwiki $VER" - git push origin "HEAD:${GITHUB_REF_NAME}" - git push origin "$TAG" + # Check if there are staged changes. If not, the version was already + # correct — create an empty commit just to have a release commit, + # and skip the tag push since it already exists on origin. + if git diff --cached --quiet; then + git commit --allow-empty -m "chore(release): $VER" + echo "No version changes — skipping tag push." + else + git commit -m "chore(release): $VER" + git tag -a "$TAG" -m "nuwiki $VER" + git push origin "HEAD:${GITHUB_REF_NAME}" + git push origin "$TAG" + fi build: name: build ${{ matrix.target }}