From 56968339dfb9ac962ab6ce02ca5378672149fe7c Mon Sep 17 00:00:00 2001 From: Jeff Ching Date: Wed, 6 Nov 2024 10:07:41 -0800 Subject: [PATCH] fix: only strip the github/repo-name prefix if the file doesn't exist (#61) Supports multi_scm Kokoro environments --- trampoline_v2.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/trampoline_v2.sh b/trampoline_v2.sh index 67372b3..6598adf 100755 --- a/trampoline_v2.sh +++ b/trampoline_v2.sh @@ -302,9 +302,12 @@ do fi done -# We want to support legacy style TRAMPOLINE_BUILD_FILE used with V1 -# script: e.g. "github/repo-name/.kokoro/run_tests.sh" -TRAMPOLINE_BUILD_FILE="${TRAMPOLINE_BUILD_FILE#github/*/}" +if [[ ! -f "${TRAMPOLINE_BUILD_FILE}" ]]; then + # We want to support legacy style TRAMPOLINE_BUILD_FILE used with V1 + # script: e.g. "github/repo-name/.kokoro/run_tests.sh" + log_yellow "TRAMPOLINE_BUILD_FILE is not found at provided path, stripping github and repo name." + TRAMPOLINE_BUILD_FILE="${TRAMPOLINE_BUILD_FILE#github/*/}" +fi log_yellow "Using TRAMPOLINE_BUILD_FILE: ${TRAMPOLINE_BUILD_FILE}" # ignore error on docker operations and test execution @@ -505,4 +508,4 @@ if [[ "${update_cache}" == "true" ]] && \ fi fi -exit "${test_retval}" \ No newline at end of file +exit "${test_retval}"