Skip to content

Commit 4783668

Browse files
jguiceclaude
andauthored
fix(ci): show modified files when pre-commit hooks fail (#45)
When a pre-commit hook like markdownlint-fix modifies files, the CI output only says "files were modified by this hook" without indicating which files changed. This adds a follow-up step that runs on failure to display both the list of modified files and the full diff. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 629e79a commit 4783668

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,14 @@ jobs:
3232

3333
- name: Run pre-commit hooks
3434
run: pre-commit run --all-files
35+
36+
- name: Show files modified by pre-commit hooks
37+
if: failure()
38+
run: |
39+
echo "::group::Files modified by pre-commit hooks"
40+
git diff --name-only
41+
echo "::endgroup::"
42+
echo ""
43+
echo "::group::Full diff of modifications"
44+
git diff
45+
echo "::endgroup::"

0 commit comments

Comments
 (0)