File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,21 +30,27 @@ jobs:
3030 chmod +x .github/scripts/extract_config.sh
3131 .github/scripts/extract_config.sh
3232
33- - name : Check if changes exist
33+ - name : Check if any file changed
3434 id : changes
3535 run : |
36- if git diff --quiet .pre-commit-config.yaml ; then
36+ if git diff --quiet; then
3737 echo "changed=false" >> $GITHUB_OUTPUT
3838 else
3939 echo "changed=true" >> $GITHUB_OUTPUT
4040 fi
4141
4242 - name : Commit & push updates
43- if : steps.changes.outputs.changed == 'true' && github.event_name == 'push'
43+ if : steps.changes.outputs.changed == 'true'
4444 run : |
4545 git config user.name "GitHub Actions"
4646 git config user.email "actions@github.com"
4747
4848 git add .
49- git commit -m "Sync pre-commit YAML config from global/precommitFile"
49+
50+ if git diff --cached --quiet; then
51+ echo "No staged changes. Skipping commit."
52+ exit 0
53+ fi
54+
55+ git commit -m "Sync pre-commit YAML configs"
5056 git push
You can’t perform that action at this time.
0 commit comments