sclorg / testing-farm-as-github-action

GitHub Action to execute tests by Testing Farm and update Pull Request status
MIT License
13 stars 11 forks source link

Change shell to python, where suitable #34

Closed zmiklank closed 9 months ago

zmiklank commented 2 years ago

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 commented 2 years ago

Another fix is https://github.com/sclorg/testing-farm-as-github-action/pull/49

phracek commented 9 months ago

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