Skip to content

Commit c6add4f

Browse files
committed
ci: allow passing a dict/list as a step parameter
In some cases we may want to pass a complex value to a step. For example: .buildkite/pipeline_pr.py \ --step-param 'retry/automatic=[{"exit_status": "*", "limit": 2}]' Signed-off-by: Pablo Barbáchano <[email protected]>
1 parent 56306be commit c6add4f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.buildkite/common.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"""
77

88
import argparse
9+
import ast
910
import json
1011
import os
1112
import random
@@ -138,7 +139,7 @@ def __call__(self, parser, namespace, value, option_string=None):
138139
res = getattr(namespace, self.dest, {})
139140
key_str, val = value.split("=", maxsplit=1)
140141
keys = key_str.split("/")
141-
update = {keys[-1]: val}
142+
update = {keys[-1]: ast.literal_eval(val)}
142143
for key in list(reversed(keys))[1:]:
143144
update = {key: update}
144145
res = overlay_dict(res, update)

0 commit comments

Comments
 (0)