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

Fix Multiline Output #85

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

theturtle32
Copy link
Contributor

@theturtle32 theturtle32 commented Nov 15, 2024

It is undocumented functionality, but this actions workflow does also expose the result of the helm command execution as an output called helm_output. Unfortunately, because a lot of unnecessary character escaping is done for newlines, carriage returns, and the percent symbol, the result is fairly difficult to use.

The Github Actions Docs specifies that you can use the same multi-line output format for outputs as you can for environment variables, so no special tricks are required. The approach is based on the same standard heredoc method you would use in a shell script.

https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#setting-an-output-parameter

https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#multiline-strings

Important

This pull request does also include a further enhancement which splits helm's NOTES.txt output from the rest of the output, and populates separate Github Actions outputs for each. This makes it easier to render the NOTES.txt into the Markdown-formatted workflow summary.

The two outputs are:

  • helm_output – Everything that was output by the helm command before the line NOTES:
  • helm_notes – Everything that was output by the helm command after the line NOTES:

Please let me know if you want a clean pull request that does not make both of these changes at once.
***Update: this has been extracted into a separate PR. #92 ***

@WyriHaximus
Copy link
Owner

It is undocumented functionality, but this actions workflow does also expose the result of the helm command execution as an output called helm_output. Unfortunately, because a lot of unnecessary character escaping is done for newlines, carriage returns, and the percent symbol, the result is fairly difficult to use.

The Github Actions Docs specifies that you can use the same multi-line output format for outputs as you can for environment variables, so no special tricks are required. The approach is based on the same standard heredoc method you would use in a shell script.

https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#setting-an-output-parameter

https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#multiline-strings

Somehow I forgot to update this one, thanks for doing that 👍 . It does need documenting tho, but I like both propose changes.

Important

This pull request does also include a further enhancement which splits helm's NOTES.txt output from the rest of the output, and populates separate Github Actions outputs for each. This makes it easier to render the NOTES.txt into the Markdown-formatted workflow summary.

The two outputs are:

  • helm_output – Everything that was output by the helm command before the line NOTES:
  • helm_notes – Everything that was output by the helm command after the line NOTES:

Please let me know if you want a clean pull request that does not make both of these changes at once.

IMHO splitting it up makes most sense, all 3 commits of the original PR are welcome as PR's.

Copy link
Owner

@WyriHaximus WyriHaximus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for splitting up the PR and doing all this work 👍

@WyriHaximus WyriHaximus merged commit c692b22 into WyriHaximus:3.x Nov 20, 2024
17 checks passed
@theturtle32
Copy link
Contributor Author

Thanks for splitting up the PR and doing all this work 👍

You're welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants