Skip to content

Commit

Permalink
testing file based approach
Browse files Browse the repository at this point in the history
  • Loading branch information
vijayamadhavareddy committed May 17, 2024
1 parent d957a98 commit 752dfbc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/aws_ssm.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def run(aws_parameters: dict[str, AwsParameter]):
params_file_path = os.getenv('INPUT_PARAMS_FILE_PATH')
if params_file_path is not None and params_file_path != "":
path = pathlib.PurePath(os.getenv('GITHUB_WORKSPACE'), params_file_path)
print(path)
with open(path, 'r') as f:
params_from_file = parse_input_params(f.read())
params = {**params_from_file, **params_inline}
Expand Down
4 changes: 3 additions & 1 deletion src/inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ def ensure_env_input(input_params: str):


def value_to_aws_parameter(param_name, param_value):
print(f"param_name: {param_name}, param_value: {param_value}")
parsed_value_json = ensure_json_input(param_value)
print(f"parsed: {parsed_value_json}")
if parsed_value_json is None:
return AwsParameter(name=param_name, value=param_value)
print(parsed_value_json)
value = parsed_value_json.get('value') if parsed_value_json.get('value') is not None else None
param_type = parsed_value_json.get('type') if parsed_value_json.get('type') is not None else 'String'
overwrite = parsed_value_json.get('overwrite') if parsed_value_json.get('overwrite') is not None else True
Expand All @@ -42,6 +43,7 @@ def value_to_aws_parameter(param_name, param_value):

def parse_input_params(input_params: str):
parsed_params_json = ensure_json_input(input_params)
print(f"parsed: {parsed_params_json}")
if parsed_params_json is not None:
return {key: value_to_aws_parameter(key, value) for key, value in parsed_params_json.items()}
parsed_params_env = ensure_env_input(input_params)
Expand Down

0 comments on commit 752dfbc

Please sign in to comment.