Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate into python scripts #48

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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