From c5b2cce4d1020886ed8c0a9b1f57ad78f0d124d7 Mon Sep 17 00:00:00 2001 From: Dimitri Yatsenko Date: Mon, 2 Feb 2026 19:19:03 -0600 Subject: [PATCH] fix: Make release workflow idempotent for re-runs Handle the case where README.md badge is already updated from a previous partial run. Uses conditional commit to avoid failure when there are no changes to commit. Co-Authored-By: Claude Opus 4.5 --- .github/workflows/post_draft_release_published.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/post_draft_release_published.yaml b/.github/workflows/post_draft_release_published.yaml index a4f4ca13e..f9b80dfdb 100644 --- a/.github/workflows/post_draft_release_published.yaml +++ b/.github/workflows/post_draft_release_published.yaml @@ -57,7 +57,8 @@ jobs: # Update src in the tag sed -i 's|\(]*src="\)[^"]*\(".*\)|\1'"$NEW_SRC"'\2|' README.md git add README.md - git commit -m "Update README.md badge to ${{ github.event.release.tag_name }}" + # Only commit if there are changes (handles re-runs gracefully) + git diff --cached --quiet README.md || git commit -m "Update README.md badge to ${{ github.event.release.tag_name }}" - name: Set up Python ${{matrix.py_ver}} uses: actions/setup-python@v5 with: