File tree Expand file tree Collapse file tree 1 file changed +15
-10
lines changed
Expand file tree Collapse file tree 1 file changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -80,14 +80,19 @@ jobs:
8080 - name : Commit and push badges
8181 if : github.event_name != 'pull_request'
8282 run : |
83- cd .github/badges
84- if [[ `git status --porcelain` ]]; then
85- git config --global user.name 'github-actions'
86- git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
87- git add *.svg
88- git add *.json
89- if ! git diff --cached --quiet; then
90- git commit -m "Update coverage badges for all modules"
91- git push
92- fi
83+ git config --global user.name 'github-actions'
84+ git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
85+
86+ # 1. Stage the specific files
87+ git add .github/badges/*.svg
88+ git add .github/badges/*.json
89+
90+ # 2. Check if the STAGED changes are different from the last commit
91+ # git diff --cached --quiet returns 1 if there are differences
92+ if ! git diff --cached --quiet; then
93+ git commit -m "Update coverage badges"
94+ git push
95+ else
96+ echo "No changes in coverage results; skipping commit."
9397 fi
98+
You can’t perform that action at this time.
0 commit comments