- 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
echo "::set-output name=TMT_ENV_VARS::$(cat variables)"
shell: bash
use python commands, but bash shell, which makes them hard-to-read.
I propose to change the shell to python and execute python commands one by one.
This should be possible, as Github Actions offer python as one of its shells[1].
It would be nice to have this covered with tests too.
Some steps in the action, e.g.:
use python commands, but bash shell, which makes them hard-to-read. I propose to change the shell to python and execute python commands one by one. This should be possible, as Github Actions offer python as one of its shells[1]. It would be nice to have this covered with tests too.
[1]https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell