Skip to content

Commit cf730a5

Browse files
pb8okalyazin
authored andcommitted
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}]' (cherry picked from commit c6add4f) Signed-off-by: Pablo Barbáchano <[email protected]>
1 parent 1fcdaec commit cf730a5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.buildkite/common.py

Lines changed: 2 additions & 1 deletion
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
@@ -133,7 +134,7 @@ def __call__(self, parser, namespace, value, option_string=None):
133134
res = getattr(namespace, self.dest, {})
134135
key_str, val = value.split("=", maxsplit=1)
135136
keys = key_str.split("/")
136-
update = {keys[-1]: val}
137+
update = {keys[-1]: ast.literal_eval(val)}
137138
for key in list(reversed(keys))[1:]:
138139
update = {key: update}
139140
res = overlay_dict(res, update)

0 commit comments

Comments
 (0)