diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index db24b44..558dffa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,11 +3,17 @@ on: push: branches: - main + workflow_dispatch: + permissions: contents: read jobs: test: runs-on: ubuntu-latest steps: - - name: test - run: echo "test" \ No newline at end of file + - name: Checkout repository + uses: actions/checkout@v4 + - name: test-file + uses: ./ + with: + params-file: ./test.json \ No newline at end of file diff --git a/src/aws_ssm.py b/src/aws_ssm.py index 68fe02e..b957e0a 100644 --- a/src/aws_ssm.py +++ b/src/aws_ssm.py @@ -16,8 +16,8 @@ def run(aws_parameters: dict[str, AwsParameter]): if __name__ == '__main__': - input_params = os.getenv('INPUT_PARAMS') - params_inline = parse_input_params(input_params) if input_params is not None else {} + input_params = os.getenv('INPUT_PARAMS', None) + params_inline = parse_input_params(input_params) if input_params is not None and input_params != '' else {} params_from_file = {} params_file_path = os.getenv('INPUT_PARAMS_FILE_PATH') if params_file_path is not None and params_file_path != "": diff --git a/src/inputs.py b/src/inputs.py index 83ca5ff..e09ecbd 100644 --- a/src/inputs.py +++ b/src/inputs.py @@ -31,7 +31,7 @@ def ensure_env_input(input_params: str): def value_to_aws_parameter(param_name, param_value): parsed_value_json = ensure_json_input(param_value) - if parsed_value_json is None: + if parsed_value_json is None or isinstance(parsed_value_json, dict) is False: return AwsParameter(name=param_name, value=param_value) 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'