Skip to content

🐛 build-labels cannot be multiline #476

@azz

Description

@azz

The handling of multi-line strings for build-labels is incorrect.

Input:

# BUILDKITE_MESSAGE="foo\nbar"

build-labels:
    - "commit.message=${BUILDKITE_MESSAGE}"

Expected:

$ docker inspect my-image  | jq .[0].Config.Labels
{
  "commit.message": "foo\nbar"
}

Actual:

{
  "commit.message": "foo",
  "bar": ""
}

This is probably due to the read here:

labels=()
while read -r label ; do
[[ -n "${label:-}" ]] && labels+=("${label}")
done <<< "$(plugin_read_list BUILD_LABELS)"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions