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

Clarify how multiline output values can be set via GITHUB_OUTPUT #21529

Open
1 task done
fingolfin opened this issue Oct 21, 2022 · 5 comments · May be fixed by #23027
Open
1 task done

Clarify how multiline output values can be set via GITHUB_OUTPUT #21529

fingolfin opened this issue Oct 21, 2022 · 5 comments · May be fixed by #23027
Labels
actions This issue or pull request should be reviewed by the docs actions team content Problems or updates in the docs content on docs.github.com. help wanted Anyone is welcome to open a pull request to fix this issue. waiting for review Issue/PR is waiting for a writer's review

Comments

@fingolfin
Copy link

fingolfin commented Oct 21, 2022

Code of Conduct

What article on docs.github.com is affected?

https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter

What part(s) of the article would you like to see updated?

Due to recent changes, I had to switch our codeflows from using set-output to the method described in the section on "Setting an output parameter", by appending to (the file with the name in the variable) $GITHUB_OUTPUT.

This is very similar to how $GITHUB_ENV works in the previous section.

I had need to post a multiline output, and so decided to just try the technique described for "Environment files" (the preceding section). That is, I used the pattern

{name}<<{delimiter}
{value}
{delimiter}

and ended up with code looking like this:

steps:
  - name: Set the output in bash
    id: step_one
    run: |
      echo 'JSON_RESPONSE<<EOF' >> $GITHUB_OUTPUT
      curl https://example.lab >> $GITHUB_OUTPUT
      echo 'EOF' >> $GITHUB_OUTPUT

And as far as I can tell, this worked great (and is much simpler than what I had to do before).

I think it would be beneficial if this possibility was pointed out by the documentation. Simply saying something akin to "multi-line output values can be set with the same technique used in the previous section to define multi-line environment variables" would already help a lot.

Additional information

No response


edited by maintainer

Content plan here

@fingolfin fingolfin added the content Problems or updates in the docs content on docs.github.com. label Oct 21, 2022
@welcome
Copy link

welcome bot commented Oct 21, 2022

Thanks for opening this issue. A GitHub docs team member should be by to give feedback soon. In the meantime, please check out the contributing guidelines.

@github-actions github-actions bot added the triage Do not begin working on this issue until triaged by the team. label Oct 21, 2022
@cmwilson21
Copy link
Collaborator

@fingolfin Thanks so much for opening an issue! I'll triage this for the team to take a look 👀

@cmwilson21 cmwilson21 added actions This issue or pull request should be reviewed by the docs actions team waiting for review Issue/PR is waiting for a writer's review and removed triage Do not begin working on this issue until triaged by the team. labels Oct 24, 2022
@skedwards88
Copy link
Contributor

Thanks for this issue! You or anyone else is welcome to open a PR to point users to the multi-line strings section from the setting an output parameter section. I would recommend including a link instead of referring to "the previous section" to help users find the info even if the structure of this article changes in the future. I think it could also be useful to include an example.

@skedwards88 skedwards88 added the help wanted Anyone is welcome to open a pull request to fix this issue. label Oct 24, 2022
@docubot docubot added this to Help wanted in Docs open source board Oct 24, 2022
@ujjwal-shekhar
Copy link
Contributor

Hi can I work on this?

@Soemind

This comment was marked as spam.

@github-actions github-actions bot added stale There is no recent activity on this issue or pull request and removed stale There is no recent activity on this issue or pull request labels Dec 30, 2022
dawei-wang added a commit to dawei-wang/docs that referenced this issue Jan 5, 2023
@dawei-wang dawei-wang linked a pull request Jan 5, 2023 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actions This issue or pull request should be reviewed by the docs actions team content Problems or updates in the docs content on docs.github.com. help wanted Anyone is welcome to open a pull request to fix this issue. waiting for review Issue/PR is waiting for a writer's review
Projects
5 participants