Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1c5fef0

Browse files
ci: check for unstaged files correctly during gen (#142)
Discovered in #141 that CI could pass even when `make gen` could produce a new file.
1 parent 1ef2a69 commit 1c5fef0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/test.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@ jobs:
5454

5555
- name: git diff
5656
run: |
57-
git diff --compact-summary --exit-code || \
58-
(echo; echo "Unexpected difference in directories after code generation. Run 'go generate ./...' command and commit."; exit 1)
57+
if [[ -n $(git ls-files --other --modified --exclude-standard) ]]; then
58+
echo "Unexpected difference in directories after code generation. Run 'make gen' and include the output in the commit."
59+
exit 1
60+
fi
5961
6062
# Run acceptance tests in a matrix with Terraform CLI versions
6163
test:

0 commit comments

Comments
 (0)