Skip to content

Commit

Permalink
ci: fix passing simple values to step parameters
Browse files Browse the repository at this point in the history
In c6add4f while adding support for
more complex parameters we broke passing simple strings.

While it can be worked around by quoting the string with '', that makes
the simple case more complex than it was before, and breaks previous
pipeline definitions.

Fix it so if the first character does not look like a python expression,
take the value verbatim.

Fixes: c6add4f

Signed-off-by: Pablo Barbáchano <[email protected]>
  • Loading branch information
pb8o committed Jan 2, 2025
1 parent 11d8a01 commit c51a52e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .buildkite/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def __call__(self, parser, namespace, value, option_string=None):
res = getattr(namespace, self.dest, {})
key_str, val = value.split("=", maxsplit=1)
keys = key_str.split("/")
update = {keys[-1]: ast.literal_eval(val)}
update = {keys[-1]: ast.literal_eval(val) if val[0] in "[{'" else val}
for key in list(reversed(keys))[1:]:
update = {key: update}
res = overlay_dict(res, update)
Expand Down

0 comments on commit c51a52e

Please sign in to comment.