Skip to content

Commit a5e0ead

Browse files
committed
🐛 fix metadata commit
1 parent 11ad22e commit a5e0ead

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

.github/workflows/python-publish.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,24 @@ jobs:
3333
- name: Build the package
3434
run: poetry build
3535

36-
# 🔹 Commit metadata back to repo
36+
# Commit metadata back to repo
3737
- name: Commit and push metadata
3838
run: |
3939
git config --global user.name "github-actions[bot]"
4040
git config --global user.email "github-actions[bot]@users.noreply.github.com"
41+
42+
# Switch to main branch
43+
git fetch origin main
44+
git checkout main
45+
46+
# Add metadata and commit only if changes exist
4147
git add metadata/
42-
git commit -m ":bookmark: Update metadata after release"
43-
git push origin HEAD:main
48+
if ! git diff --cached --quiet; then
49+
git commit -m ":bookmark: Update metadata after release"
50+
git push origin main
51+
else
52+
echo "No changes to commit"
53+
fi
4454
4555
- name: Configure Poetry for PyPI
4656
run: |

0 commit comments

Comments
 (0)