diff --git a/hooks/pre-exit b/hooks/pre-exit index cca947d..286ae0a 100755 --- a/hooks/pre-exit +++ b/hooks/pre-exit @@ -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 diff --git a/tests/pre-exit-success.bats b/tests/pre-exit-success.bats index 7863904..9b287ae 100644 --- a/tests/pre-exit-success.bats +++ b/tests/pre-exit-success.bats @@ -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" {