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

Multiline outputs support in the GitHub action #936

Closed
pjxiao opened this issue Sep 12, 2021 · 0 comments · Fixed by #937
Closed

Multiline outputs support in the GitHub action #936

pjxiao opened this issue Sep 12, 2021 · 0 comments · Fixed by #937

Comments

@pjxiao
Copy link

pjxiao commented Sep 12, 2021

Please describe your feature request.

  • Support multiline outputs in the Github Actions

  • Even though yq produces a multiline output, only the first line of it is stored in the outputs.result

  • Current behaviour:
    example: https://github.com/pjxiao/yq-action/runs/3577428434

    jobs:
      convert-to-json:
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v2
          - name: This outputs multiline JSON
            uses: mikefarah/yq@v4.12.2
            id: act
            with:
              cmd: yq eval --output-format=json 'config.yml'
    
          - name: But we get only the first line here
            env:
              ACT_RESULT: ${{ steps.act.outputs.result }}  # = "{"
            run: echo "${ACT_RESULT}"

Describe the solution you'd like

  • If yq produces a multiline output, the entire output is store in the outputs.result

  • Expected behaviour:

    example: https://github.com/pjxiao/yq-action/runs/3577428423

    jobs:
      convert-to-json:
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v2
          - name: This outputs multiline JSON
            uses: mikefarah/yq@v4.12.2
            id: act
            with:
              cmd: yq eval --output-format=json 'config.yml'
    
          - name: I'd like to get the entire JSON
            env:
              ACT_RESULT: ${{ steps.act.outputs.result }}
            run: echo "${ACT_RESULT}"

Additional context

  • This is useful when we use yq as a YAML/JSON converter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant