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

Closed
1 task done
fingolfin opened this issue Oct 21, 2022 · 5 comments · Fixed by #23027
Closed
1 task done

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

fingolfin opened this issue Oct 21, 2022 · 5 comments · Fixed by #23027
Labels
actions This issue or pull request should be reviewed by the docs actions team content This issue or pull request belongs to the Docs Content team 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 This issue or pull request belongs to the Docs Content team 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
Contributor

@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
@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
@mchammer01 mchammer01 assigned mchammer01 and unassigned mchammer01 Feb 7, 2023
julienduchesne added a commit to grafana/mimir that referenced this issue Mar 6, 2023
Summary should use the multiline format: github/docs#21529
pracucci pushed a commit to grafana/mimir that referenced this issue Mar 7, 2023
* `mimir-rules-action`: `set-output` is deprecated

See https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

`set-output` will stop working on June 1st and is currently warning

* Update entrypoint.sh

* Correctly output multiline

Summary should use the multiline format: github/docs#21529

* Use `ENDOFSUMMARY` instead of EOF
maxh added a commit to loop-payments/prisma-lint that referenced this issue May 30, 2023
MartinThoma added a commit to py-pdf/pypdf that referenced this issue Jul 20, 2023
Struggling with multiline environment variables

See github/docs#21529

See #1971
djzager added a commit to djzager/release-tools that referenced this issue Aug 14, 2023
Turns out you can't shove multiline strings into GITHUB_OUTPUT without heredoc syntax.
github/docs#21529

Signed-off-by: David Zager <[email protected]>
djzager added a commit to konveyor/release-tools that referenced this issue Aug 14, 2023
Turns out you can't shove multiline strings into GITHUB_OUTPUT without
heredoc syntax. github/docs#21529

Signed-off-by: David Zager <[email protected]>
giovanni-guidini added a commit to giovanni-guidini/sentry that referenced this issue Oct 19, 2023
Fixing the post processing of label analysis failure based on POC runs
(see https://github.com/giovanni-guidini/components-demo/actions/runs/6579967512/job/17876943612 for the end result)

The strange syntax came from github/docs#21529

Also letting label-analysis step fail (_after_ the post processing)
Soap2G added a commit to atlas-outreach-data-tools/notebooks-collection-opendata that referenced this issue May 24, 2024
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 This issue or pull request belongs to the Docs Content team 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
None yet
6 participants