Skip to content

Commit 2365542

Browse files
dkoshkinjimmidyson
authored andcommitted
ci: use changed-files GHA to check for dirty git state
1 parent 464d01f commit 2365542

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

.github/workflows/checks.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,15 @@ 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
174+
- name: Get changed files since last commit
175+
id: changed-files
176+
uses: tj-actions/changed-files@v44
177+
- name: Fail if there are changed files
178+
if: steps.changed-files.outputs.any_changed
179+
uses: actions/github-script@v3
180+
with:
181+
script: |
182+
core.setFailed('Discovered changed files: ${{ steps.changed-files.outputs.all_changed_files }}')
176183
177184
lint-test-helm:
178185
runs-on: ubuntu-22.04

make/repo.mk

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,3 @@ 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)