Skip to content

Commit

Permalink
test action
Browse files Browse the repository at this point in the history
  • Loading branch information
vijayamadhavareddy committed Apr 15, 2024
1 parent f723c60 commit ed03771
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,25 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: test parameter store
- name: test parameter store - input env
uses: ./
with:
parameters: test=test

- name: test parameter store
- name: test parameter store - input multiline env
uses: ./
with:
parameters: |
test=test
test1="test1"
- name: test parameter store - input variables
uses: ./
env:
ENV_VAL: ${{ github.workspace }}
with:
parameters: |
test=test
test1="test1"
env_val=${{ env.ENV_VAL }}
11 changes: 0 additions & 11 deletions src/aws_ssm.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@


def run(aws_parameters: dict[str, AwsParameter]):
print(aws_parameters)
for n, p in aws_parameters.items():
print(f"{n}: {p.value}")
ssm_client = get_client(service_name='ssm',
region_name=os.getenv('AWS_REGION'),
aws_access_key=os.getenv('AWS_ACCESS_KEY'),
Expand All @@ -19,18 +16,10 @@ def run(aws_parameters: dict[str, AwsParameter]):


if __name__ == '__main__':
print("test")
input_params = os.getenv('INPUT_PARAMS')
print(f"input_params")
print(input_params)
params_inline = parse_input_params(input_params) if input_params is not None else {}
print("params_inline")
print(params_inline)
params_from_file = {}
params_file_path = os.getenv('INPUT_PARAMS_FILE_PATH')
print(f"params_file_path: {params_file_path}")
print(params_file_path)
print(f"workspace: {os.getenv('GITHUB_WORKSPACE')}")
if params_file_path is not None and params_file_path != "":
path = pathlib.PurePath(os.getenv('GITHUB_WORKSPACE'), params_file_path)
with open(path, 'r') as f:
Expand Down
4 changes: 0 additions & 4 deletions src/inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ def env_to_param(env_line: str) -> AwsParameter:

def ensure_env_input(input_params: str):
param_lines = input_params.strip().split(sep="\n")
print("param_lines")
print(param_lines)
return [param_line.strip() for param_line in param_lines]


Expand All @@ -47,6 +45,4 @@ def parse_input_params(input_params: str):
return {key: value_to_aws_parameter(key, value) for key, value in parsed_params_json.items()}
parsed_params_env = ensure_env_input(input_params)
parsed_aws_params_env = [env_to_param(env_param) for env_param in parsed_params_env]
print("parsed_aws_params_env")
print(parsed_aws_params_env)
return {p.name: p for p in parsed_aws_params_env}

0 comments on commit ed03771

Please sign in to comment.