ci(release): build release notes from CHANGELOG; auto-populate PSData.ReleaseNotes; harden version expansion#56
Conversation
…pansion Adopts the release-tooling pattern from PowerShellModuleTemplate (#31). - Create GitHub Release: extract the published version's section from CHANGELOG.md and pass it via --notes-file (pwsh), instead of --generate-notes (which lists every merged PR since the last release tag and buries user-facing changes under bot/CI/chore noise). Reads CHANGELOG.md defensively (Test-Path + try/catch) and excludes the current tag from the compare-link base; falls back to --generate-notes if there's no readable section, so a release is never blocked. - Pass the version output via env (VERSION) in the release-check, PSGallery-check, and create-release steps instead of inlining ${{ steps.version.outputs.version }} into run scripts (template-injection class flagged by zizmor/CodeRabbit). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
So the PowerShell Gallery release-notes panel shows the curated, user-facing notes for each version (matching the GitHub release body) instead of a static link. - build.depend.psd1: add ChangelogManagement 3.1.0 (Keep a Changelog parser). - build.psake.ps1: new UpdateReleaseNotes task (Depends Build) that reads the entry matching the module version via Get-ChangelogData and sets the built manifest's PrivateData.PSData.ReleaseNotes via Update-ModuleManifest. Wired in through $PSBPublishDependency so it runs before Publish-PSBuildModule. Skips empty entries and is non-fatal if the changelog can't be read. Verified: ChangelogManagement parses this repo's CHANGELOG (0.11.2 resolvable). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR updates the release/publish pipeline so both GitHub Releases and the PowerShell Gallery “Release Notes” are derived from CHANGELOG.md, and it reduces risk from inline workflow-expression expansion by passing the version via env:.
Changes:
- Add a psake task to update the staged module manifest’s release notes from the matching
CHANGELOG.mdentry before publishing. - Add
ChangelogManagementas a build dependency to parse Keep a Changelog–style entries. - Update the publish workflow to build GitHub release notes from
CHANGELOG.md(with defensive fallback to--generate-notes) and harden version usage by using environment variables.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
build.psake.ps1 |
Adds UpdateReleaseNotes task and wires it into publish dependencies so the staged manifest gets release notes from CHANGELOG.md. |
build.depend.psd1 |
Adds ChangelogManagement dependency required by the new build task. |
.github/workflows/PublishModuleToPowerShellGallery.yaml |
Switches GitHub release creation to use changelog-derived notes (fallback to auto notes) and passes version via env: instead of inline expressions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Addresses Copilot review on #56: the task is described as non-fatal, but the final Update-ModuleManifest -ErrorAction Stop was unguarded, so a failure (e.g. missing built manifest) would hard-fail Publish. Add a Test-Path check for the built manifest and wrap the update in try/catch that warns and leaves the existing ReleaseNotes in place, keeping the release unblocked as intended. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
Summary
Adopts the release-tooling pattern from PowerShellModuleTemplate#31 (merged) — the first consumer rollout. Three changes, all in the build/publish files (no module/source changes).
CHANGELOG.md(replaces--generate-notes):Create GitHub Releaseextracts the published version's section and passes it via--notes-file(pwsh). Reads defensively (Test-Path+ try/catch → falls back to--generate-notesif missing/unreadable) and excludes the current tag from the compare-link base.PSData.ReleaseNotesat publish: addChangelogManagement3.1.0; newUpdateReleaseNotesbuild task sets the built manifest'sPrivateData.PSData.ReleaseNotesfrom the matching CHANGELOG entry (via$PSBPublishDependency, before publish). Skips empty entries; non-fatal.${{ steps.version.outputs.version }}viaenv:in the three steps that used it inline (template-injection class).So the GitHub release and the Gallery
ReleaseNotesboth derive from the sameCHANGELOG.md.Verification
ChangelogManagementparses this repo's CHANGELOG (LastVersion0.11.2, 22 versions, current version resolvable).build.psake.ps1parses; no inline${{ }}remain in anyrun:body.build.psake.ps1is structurally identical to the template's, so the wiring matches the validated reference; theUpdateReleaseNotesmechanism was validated end-to-end in ScheduledTasksManager.Pilot for the consumer rollout — once green, the same diff goes to
JsmOperations/ReScenePS/SrrDBAutomationToolkit.🤖 Generated with Claude Code