diff --git a/.github/workflows/convert-images.yml b/.github/workflows/convert-images.yml index 90ed803..13cf118 100644 --- a/.github/workflows/convert-images.yml +++ b/.github/workflows/convert-images.yml @@ -30,10 +30,13 @@ jobs: # 提交转换后的图片 - name: Commit and push changes - continue-on-error: true run: | git config user.name "GitHub Actions" git config user.email "actions@github.com" - git add images/ images.json - git commit -m "Auto-generate images.json and converted images" || echo "No changes to commit" - git push || echo "No changes to push" + if [ -n "$(git status --porcelain)" ]; then + git add images/ images.json + git commit -m "Auto-generate images.json and converted images" + git push + else + echo "No changes to commit, skipping push" + fi