1 parent 71b432d commit 1b8738dCopy full SHA for 1b8738d
1 file changed
.github/workflows/format.yml
@@ -37,11 +37,17 @@ jobs:
37
if: github.event_name == 'push'
38
shell: bash
39
run: |
40
+ set -euo pipefail
41
echo "Checking diff and committing if needed..."
42
git config --global user.name "GitHub Actions Bot"
43
git config --global user.email "actions@github.com"
44
- if ! git diff --quiet; then
45
- echo "Changes detected. Committing..."
46
- git add -A
47
- git commit -m "Auto-format C/C++ code with clang-format"
+ if git diff --quiet; then
+ echo "No changes to commit. (Still executed on push)"
+ exit 0
48
+ fi
49
+
50
+ echo "Changes detected. Committing..."
51
+ git add -A
52
+ git commit -m "Auto-format C/C++ code with clang-format"
53
+ git push
0 commit comments