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 output #2

Closed
rosshamish opened this issue Dec 6, 2021 · 3 comments · Fixed by #3
Closed

Multiline output #2

rosshamish opened this issue Dec 6, 2021 · 3 comments · Fixed by #3
Labels
enhancement New feature or request

Comments

@rosshamish
Copy link

Hey there, thanks for the action. Would you be open to accepting a PR that adds support for multiline output? It's helpful for example when outputting one field from each item in a list. Right now, if the jq output has multiple lines, only the first line is set as the output, and the rest of the lines are just written to stdout.

It would look like this:

    - name: Extract contributed themes from package.json
      uses: .sergeysova/jq-action@v2
      id: themes
      with:
        cmd: 'jq .contributes.themes[].path ${{ inputs.working-directory }}/package.json --raw-output'
        multiline: true

And then the multiline output can be used like

    - name: Verify each contributed theme exists
      shell: bash
      run: |
        themes_in_package_json="${{ steps.themes.outputs.value }}"
        for theme in $themes_in_package_json; do
            ....
        done

Let me know! Thanks.

@rosshamish
Copy link
Author

Friendly ping @sergeysova - I'd like to contribute support for multiline output. Let me know if you'd be interested in a pull request.

@sergeysova
Copy link
Owner

@rosshamish If you need to add this feature, I would be grateful for your PR.

@sergeysova sergeysova added the enhancement New feature or request label Dec 20, 2021
@rosshamish
Copy link
Author

I posted a PR! #3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants