Skip to content

Commit

Permalink
Merge pull request #68 from benvernier-sc/fix-name-parentheses
Browse files Browse the repository at this point in the history
Surround env vars in quotes to support parentheses
  • Loading branch information
pzeballos authored Feb 3, 2024
2 parents b0caed3 + a539be4 commit d209be7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions hooks/pre-exit
Original file line number Diff line number Diff line change
Expand Up @@ -107,22 +107,22 @@ upload() {
"--form" "format=${format}"
"--form" "data=@\"$file\""
"--form" "run_env[CI]=buildkite"
"--form" "run_env[key]=$BUILDKITE_BUILD_ID"
"--form" "run_env[url]=$BUILDKITE_BUILD_URL"
"--form" "run_env[branch]=$BUILDKITE_BRANCH"
"--form" "run_env[commit_sha]=$BUILDKITE_COMMIT"
"--form" "run_env[number]=$BUILDKITE_BUILD_NUMBER"
"--form" "run_env[job_id]=$BUILDKITE_JOB_ID"
"--form" "run_env[message]=$BUILDKITE_MESSAGE"
"--form" "run_env[key]=\"$BUILDKITE_BUILD_ID\""
"--form" "run_env[url]=\"$BUILDKITE_BUILD_URL\""
"--form" "run_env[branch]=\"$BUILDKITE_BRANCH\""
"--form" "run_env[commit_sha]=\"$BUILDKITE_COMMIT\""
"--form" "run_env[number]=\"$BUILDKITE_BUILD_NUMBER\""
"--form" "run_env[job_id]=\"$BUILDKITE_JOB_ID\""
"--form" "run_env[message]=\"$BUILDKITE_MESSAGE\""
"--form" "run_env[collector]=test-collector-buildkite-plugin"
)

if [[ "$DEBUG" == "true" ]]; then
curl_args+=("--form" "run_env[debug]=$DEBUG")
curl_args+=("--form" "run_env[debug]=\"$DEBUG\"")
fi

if [[ -n "$PLUGIN_VERSION" ]]; then
curl_args+=("--form" "run_env[version]=$PLUGIN_VERSION")
curl_args+=("--form" "run_env[version]=\"$PLUGIN_VERSION\"")
fi

if [[ "$ANNOTATE" != "false" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion tests/pre-exit-success.bats
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ COMMON_CURL_OPTIONS='--form \* --form \* --form \* --form \* --form \* --form \*

assert_success
assert_output --partial "curl success"
assert_output --partial "run_env[version]=some-commit-id"
assert_output --partial "run_env[version]=\"some-commit-id\""
}

@test "Follow links option enabled adds find option" {
Expand Down

0 comments on commit d209be7

Please sign in to comment.