Skip to content

Commit 5abc6a2

Browse files
committed
build: fetch target branch in Kokoro to resolve diff error
1 parent 832af4c commit 5abc6a2

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

.kokoro/common.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ function generate_modified_modules_list() {
236236
# grep returns 1 (error code) and exits the pipeline if there is no match
237237
# If there is no match, it will return true so the rest of the commands can run
238238
git config --global --add safe.directory $(realpath .)
239+
git fetch origin "${KOKORO_GITHUB_PULL_REQUEST_TARGET_BRANCH}" || true
239240
modified_files=$(git diff --name-only "${KOKORO_GITHUB_PULL_REQUEST_TARGET_BRANCH}...${KOKORO_GITHUB_PULL_REQUEST_COMMIT}")
240241
printf "Modified files:\n%s\n" "${modified_files}"
241242

0 commit comments

Comments
 (0)