From b03fac4f903a60bc8eaed1ad5c5477167caababe Mon Sep 17 00:00:00 2001 From: typhoonzero Date: Thu, 19 Jul 2018 10:06:25 +0800 Subject: [PATCH] get more accurate file changes --- paddle/scripts/paddle_build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/paddle/scripts/paddle_build.sh b/paddle/scripts/paddle_build.sh index c9f741274..9837117fb 100755 --- a/paddle/scripts/paddle_build.sh +++ b/paddle/scripts/paddle_build.sh @@ -333,7 +333,8 @@ function assert_api_not_changed() { python ${PADDLE_ROOT}/tools/diff_api.py ${PADDLE_ROOT}/paddle/fluid/API.spec new.spec deactivate - API_CHANGE=`git diff --name-only HEAD^ | grep "paddle/fluid/API.spec" || true` + # Use git diff --name-only HEAD^ may not get file changes for update commits in one PR + API_CHANGE=`echo $CHANGED_FILES | grep "paddle/fluid/API.spec" || true` echo "checking API.spec change, PR: ${GIT_PR_ID}, changes: ${API_CHANGE}" if [ ${API_CHANGE} ] && [ "${GIT_PR_ID}" != "" ]; then # TODO: curl -H 'Authorization: token ${TOKEN}' -- GitLab