Skip to content

Commit 464d01f

Browse files
dkoshkinjimmidyson
authored andcommitted
ci: check git status
1 parent 53ffa18 commit 464d01f

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

.github/workflows/checks.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,9 @@ jobs:
171171
env:
172172
SKIP: no-commit-to-branch,golangci-lint,actionlint-system
173173

174+
- name: Run git status and fail on a dirty state
175+
run: devbox run -- make git.status
176+
174177
lint-test-helm:
175178
runs-on: ubuntu-22.04
176179
steps:

make/repo.mk

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,10 @@ ifneq ($(shell git status --porcelain 2>/dev/null; echo $$?), 0)
1717
else
1818
export GIT_TREE_STATE :=
1919
endif
20+
21+
.PHONY: git.status
22+
git.status: ## Returns exit code of 1 if the git tree is dirty
23+
@if [ -n "$(GIT_TREE_STATE)" ]; then \
24+
git status --porcelain 2>/dev/null; \
25+
exit 1; \
26+
fi

0 commit comments

Comments
 (0)