From 143f891058420370bcb36abbef4a85d1a94d9120 Mon Sep 17 00:00:00 2001 From: Uno-Takashi Date: Wed, 24 Jun 2026 22:44:30 +0000 Subject: [PATCH] fix(release): skip bump commit when version unchanged and force-update tag --- .github/workflows/release.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d1d7031..a84d62a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,8 +35,20 @@ jobs: git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" git add package.json - git commit -m "chore: bump version to v${VERSION} [skip ci]" - git push origin HEAD:main + if git diff --cached --quiet; then + echo "package.json already at v${VERSION}; skipping bump commit" + else + git commit -m "chore: bump version to v${VERSION} [skip ci]" + git push origin HEAD:main + fi + + - name: Force-update release tag + env: + VERSION: ${{ inputs.version }} + run: | + set -euo pipefail + git tag -f "v${VERSION}" + git push origin "refs/tags/v${VERSION}" --force - name: Create GitHub Release uses: softprops/action-gh-release@v2