Skip to content

Commit 5d5e6bf

Browse files
authored
Merge pull request #1369 from datajoint/fix/release-workflow-idempotent
2 parents a97d5eb + c5b2cce commit 5d5e6bf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.github/workflows/post_draft_release_published.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ jobs:
5757
# Update src in the <img> tag
5858
sed -i 's|\(<img id="commit-since-release-img"[^>]*src="\)[^"]*\(".*\)|\1'"$NEW_SRC"'\2|' README.md
5959
git add README.md
60-
git commit -m "Update README.md badge to ${{ github.event.release.tag_name }}"
60+
# Only commit if there are changes (handles re-runs gracefully)
61+
git diff --cached --quiet README.md || git commit -m "Update README.md badge to ${{ github.event.release.tag_name }}"
6162
- name: Set up Python ${{matrix.py_ver}}
6263
uses: actions/setup-python@v5
6364
with:

0 commit comments

Comments
 (0)