Skip to content

Commit 74193bc

Browse files
authored
ci: fail Lint gen on newly created files (#504)
'git diff --exit-code' only inspects tracked files, so when 'make gen' produces new Markdown (e.g. for a new resource or data source), the check passes while the generated file remains uncommitted. Switch the check to 'git status --porcelain' so both modifications and untracked output fail the step, and print the offending paths and diff for easier debugging. Generated by Coder Agents on behalf of @zedkipp.
1 parent af77cd5 commit 74193bc

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

.github/workflows/test.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,4 +158,9 @@ jobs:
158158
- name: Lint gen
159159
run: |
160160
make gen
161-
git diff --exit-code
161+
if [ -n "$(git status --porcelain)" ]; then
162+
echo "make gen produced changes; run 'make gen' locally and commit the result:"
163+
git status --porcelain
164+
git --no-pager diff
165+
exit 1
166+
fi

0 commit comments

Comments
 (0)