Skip to content

Commit 638e263

Browse files
committed
Guard against bad diff
1 parent 5bea462 commit 638e263

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,18 @@ deps: .state/env/pyvenv.cfg
132132
github-actions-deps:
133133
ifneq ($(GITHUB_BASE_REF), false)
134134
git fetch origin $(GITHUB_BASE_REF):refs/remotes/origin/$(GITHUB_BASE_REF)
135+
# Check that the following diff will exit with 0 or 1
136+
git diff --name-only FETCH_HEAD || test $? -le 1 || exit 1
137+
# Make the dependencies if any changed files are requirements files, otherwise exit
135138
git diff --name-only FETCH_HEAD | grep '^requirements/' || exit 0 && $(MAKE) deps
136139
endif
137140

138141
travis-deps:
139142
ifneq ($(PR), false)
140143
git fetch origin $(BRANCH):refs/remotes/origin/$(BRANCH)
144+
# Check that the following diff will exit with 0 or 1
145+
git diff --name-only $(BRANCH) || test $? -le 1 || exit 1
146+
# Make the dependencies if any changed files are requirements files, otherwise exit
141147
git diff --name-only $(BRANCH) | grep '^requirements/' || exit 0 && $(MAKE) deps
142148
endif
143149

0 commit comments

Comments
 (0)