Skip to content

Commit 1b8738d

Browse files
committed
format
1 parent 71b432d commit 1b8738d

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

‎.github/workflows/format.yml‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,17 @@ jobs:
3737
if: github.event_name == 'push'
3838
shell: bash
3939
run: |
40+
set -euo pipefail
4041
echo "Checking diff and committing if needed..."
4142
git config --global user.name "GitHub Actions Bot"
4243
git config --global user.email "actions@github.com"
4344
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"
45+
if git diff --quiet; then
46+
echo "No changes to commit. (Still executed on push)"
47+
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

Comments
 (0)