Skip to content

Commit 33699c7

Browse files
committed
Make formatting fixes a downloadable artifact
1 parent 01e2c74 commit 33699c7

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

Diff for: .github/workflows/make.yml

+12-3
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,21 @@ jobs:
1616
if: '!cancelled()'
1717
run: |
1818
clang-format -i */*.[ch]
19-
if git diff | grep ""; then
20-
(echo "Formatting errors detected by clang-format." \
21-
"Please run \`make format\`.";
19+
git diff > formatting-fixes.diff
20+
if ! grep "" formatting-fixes.diff; then
21+
rm -f formatting-fixes.diff
22+
else
23+
(echo "Formatting errors detected by clang-format. Please run" \
24+
"\`make format\` or apply formatting-fixes.diff below.";
2225
echo) >> $GITHUB_STEP_SUMMARY
2326
false
2427
fi
28+
- uses: actions/upload-artifact@v4
29+
if: '!cancelled()'
30+
with:
31+
if-no-files-found: ignore
32+
name: formatting-fixes.diff
33+
path: formatting-fixes.diff
2534
- name: Check C89 compliance
2635
if: '!cancelled()'
2736
env:

0 commit comments

Comments
 (0)