Skip to content

Commit 12c9b8b

Browse files
committed
Fix diff comparison for master merge
Need to check file changes in TRAVIS_COMMIT_RANGE
1 parent 9f7046a commit 12c9b8b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- pip install --upgrade pip
2222
- make dev-env
2323
script:
24-
- if [ $(make n-docs-diff) -ne 0 ]; then make tx-en; fi;
24+
- if [ $(make n-docs-diff DIFF_RANGE=$TRAVIS_COMMIT_RANGE) -ne 0 ]; then make tx-en; fi;
2525

2626
stages:
2727
- name: test-pr

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
SHELL:=bash
77
OWNER:=jupyter
88
ARCH:=$(shell uname -m)
9+
DIFF_RANGE?=master...HEAD
910

1011
# Need to list the images in build dependency order
1112
ifeq ($(ARCH),ppc64le)
@@ -61,10 +62,11 @@ docs: ## build HTML documentation
6162
make -C docs html
6263

6364
n-docs-diff: ## number of docs/ files changed since branch from master
64-
@git diff --name-only master...HEAD -- docs/ | wc -l | awk '{print $$1}'
65+
@git diff --name-only $(DIFF_RANGE) -- docs/ | wc -l | awk '{print $$1}'
66+
6567

6668
n-other-diff: ## number of files outside docs/ changed since branch from master
67-
@git diff --name-only master...HEAD -- ':!docs/' | wc -l | awk '{print $$1}'
69+
@git diff --name-only $(DIFF_RANGE) -- ':!docs/' | wc -l | awk '{print $$1}'
6870

6971
tx-en: ## rebuild en locale strings and push to master
7072
git config --global user.email "[email protected]"

0 commit comments

Comments
 (0)