diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7f44862..8990c9a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,8 +40,20 @@ jobs: git config user.name "github-actions[bot]" git config user.email "github-actions[bot]@users.noreply.github.com" git add pyproject.toml - git commit -m "chore: bump version to v${VERSION} [skip ci]" - git push origin HEAD:main + if git diff --cached --quiet; then + echo "pyproject.toml 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: ${{ github.event.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