Fix release notes losing newlines/content in GitHub Release and PS Gallery#111
Merged
Fix release notes losing newlines/content in GitHub Release and PS Gallery#111
Conversation
Using body: with a template expression inlines the multiline string directly into YAML, which collapses newlines. Write notes to a file and use body_path instead, which preserves formatting. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Both body: and RELEASE_NOTES: env var used template expressions that inline multiline strings into YAML, collapsing newlines and producing invalid YAML respectively. Fix: write notes to release-notes.md and read from it in both steps: - softprops/action-gh-release uses body_path: release-notes.md - Publish-Module reads the file via Get-Content -Raw Also removes the now-unnecessary step output (GITHUB_OUTPUT heredoc). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes release notes formatting/emptiness issues in the release pipeline by persisting generated notes to a file and reusing it for both the GitHub Release body and PowerShell Gallery publication.
Changes:
- Write generated release notes to
release-notes.mdinstead of exporting them via step outputs/env vars. - Update
softprops/action-gh-releaseto usebody_pathto preserve multiline formatting. - Update
Publish-Moduleto read release notes from the file viaGet-Content -Raw.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When using template expressions inline in YAML, GitHub Actions substitutes the multiline string before YAML parsing:
body:inwith:block: newlines are collapsed - release description appears as a single line (observed in v2.10 release)RELEASE_NOTES:inenv:block: multiline value produces invalid YAML - env var is empty - PS Gallery release notes are emptyFix
Write the generated notes to
release-notes.mdonce, then read from it in both steps:softprops/action-gh-releaseusesbody_path: release-notes.mdinstead ofbody:Publish-ModulereadsGet-Content -Path release-notes.md -Rawinstead of the env varThe now-unnecessary GITHUB_OUTPUT heredoc (step output) is also removed.