Skip to content

Commit 209126b

Browse files
authored
chore(internal/kokoro): wrap variable in quotes (#13821)
Wrap variable expansion in double quotes for `-z` length check to fix error regularly seen in kokoro: `github/google-cloud-go/internal/kokoro/presubmit.sh: line 93: [: too many arguments`. This happens when `$SIGNIFICANT_CHANGES` contains multiple, space separated values, which is often. This is from a recent PR: <img width="912" height="543" alt="image" src="https://togithub.com/user-attachments/assets/d0db59af-8bb5-4298-93a0-8cf6981704b0" />
1 parent edc2b93 commit 209126b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/kokoro/presubmit.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ runPresubmitTests() {
9090
SIGNIFICANT_CHANGES=$(git --no-pager diff --name-only origin/$KOKORO_GITHUB_PULL_REQUEST_TARGET_BRANCH_google_cloud_go...$KOKORO_GIT_COMMIT_google_cloud_go |
9191
grep -Ev '(\.md$|^\.github|\.json$|\.yaml$)' | xargs dirname | sort -u || true)
9292

93-
if [ -z $SIGNIFICANT_CHANGES ]; then
93+
if [ -z "$SIGNIFICANT_CHANGES" ]; then
9494
echo "No changes detected, skipping tests"
9595
exit 0
9696
fi

0 commit comments

Comments
 (0)