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

Change shell to python, where suitable #34

Closed
zmiklank opened this issue Mar 2, 2022 · 2 comments
Closed

Change shell to python, where suitable #34

zmiklank opened this issue Mar 2, 2022 · 2 comments

Comments

@zmiklank
Copy link
Collaborator

zmiklank commented Mar 2, 2022

Some steps in the action, e.g.:

    - 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.

[1]https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsshell

@phracek
Copy link
Member

phracek commented May 30, 2022

Another fix is #49

@phracek
Copy link
Member

phracek commented Nov 28, 2023

We will use TypeScript soon. This is not valid anymore.

@phracek phracek closed this as completed Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants