Skip to content

Commit

Permalink
Migrate into python scripts
Browse files Browse the repository at this point in the history
Signed-off-by: Petr "Stone" Hracek <[email protected]>
  • Loading branch information
phracek committed May 30, 2022
1 parent 08d671d commit 6b160a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
tests/copr_artifacts
tests/secrets
tests/variables
tests/artifacts
6 changes: 3 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,21 +113,21 @@ runs:
- name: Generate tmt variables
id: generate_tmt_vars
run: |
python -c 'import json; print({} if not "${{ inputs.variables }}".strip() else json.dumps({key: value for key, value in [s.split("=", 1) for s in "${{ inputs.variables }}".split(";")]}))' > variables
python generate_tmt_vars.py "variables" "${{ inputs.variables }}"
echo "::set-output name=TMT_ENV_VARS::$(cat variables)"
shell: bash

- name: Generate tmt secrets
id: generate_tmt_secrets
run: |
python -c 'import json; print({} if not "${{ inputs.secrets }}".strip() else json.dumps({key: value for key, value in [s.split("=", 1) for s in "${{ inputs.secrets }}".split(";")]}))' > secrets
python generate_tmt_vars.py "secrets" "${{ inputs.secrets }}"
echo "::set-output name=TMT_ENV_SECRETS::$(cat secrets)"
shell: bash

- name: Generate tmt artifacts
id: generate_artifacts
run: |
python -c 'import json;print("" if not "${{ inputs.copr_artifacts }}".strip() else "\"artifacts\"" + ": " + json.dumps(([{"type": "fedora-copr-build", "id": "{}:${{ inputs.copr }}".format(copr_id)} for copr_id in "${{ inputs.copr_artifacts }}".split(";")])) + ",")' > copr_artifacts
python generate_artifacts.py "${{ inputs.copr_artifacts }}" "${{ inputs.copr }}"
echo "::set-output name=TMT_ENV_ARTIFACTS::$(cat copr_artifacts)"
shell: bash

Expand Down

0 comments on commit 6b160a2

Please sign in to comment.