Skip to content

ci(release): build release notes from CHANGELOG; auto-populate PSData.ReleaseNotes; harden version expansion#56

Merged
tablackburn merged 3 commits into
mainfrom
ci/release-tooling-from-changelog
May 21, 2026
Merged

ci(release): build release notes from CHANGELOG; auto-populate PSData.ReleaseNotes; harden version expansion#56
tablackburn merged 3 commits into
mainfrom
ci/release-tooling-from-changelog

Conversation

@tablackburn
Copy link
Copy Markdown
Owner

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).

  1. GitHub release notes from CHANGELOG.md (replaces --generate-notes): Create GitHub Release extracts the published version's section and passes it via --notes-file (pwsh). Reads defensively (Test-Path + try/catch → falls back to --generate-notes if missing/unreadable) and excludes the current tag from the compare-link base.
  2. Auto-populate PSData.ReleaseNotes at publish: add ChangelogManagement 3.1.0; new UpdateReleaseNotes build task sets the built manifest's PrivateData.PSData.ReleaseNotes from the matching CHANGELOG entry (via $PSBPublishDependency, before publish). Skips empty entries; non-fatal.
  3. Harden version expansion: pass ${{ steps.version.outputs.version }} via env: in the three steps that used it inline (template-injection class).

So the GitHub release and the Gallery ReleaseNotes both derive from the same CHANGELOG.md.

Verification

  • ChangelogManagement parses this repo's CHANGELOG (LastVersion 0.11.2, 22 versions, current version resolvable).
  • Workflow YAML parses; build.psake.ps1 parses; no inline ${{ }} remain in any run: body.
  • build.psake.ps1 is structurally identical to the template's, so the wiring matches the validated reference; the UpdateReleaseNotes mechanism 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

tablackburn and others added 2 commits May 20, 2026 19:36
…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>
Copilot AI review requested due to automatic review settings May 20, 2026 23:36
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 20, 2026

Warning

Rate limit exceeded

@tablackburn has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 4 minutes and 39 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 06d304c5-dfdc-4a21-a3b1-ad479b36d018

📥 Commits

Reviewing files that changed from the base of the PR and between b7cfa16 and 7b53945.

📒 Files selected for processing (3)
  • .github/workflows/PublishModuleToPowerShellGallery.yaml
  • build.depend.psd1
  • build.psake.ps1
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/release-tooling-from-changelog

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.md entry before publishing.
  • Add ChangelogManagement as 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.

Comment thread build.psake.ps1 Outdated
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>
@tablackburn
Copy link
Copy Markdown
Owner Author

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 21, 2026

✅ Actions performed

Full review triggered.

@tablackburn tablackburn merged commit 8cbf0c0 into main May 21, 2026
15 checks passed
@tablackburn tablackburn deleted the ci/release-tooling-from-changelog branch May 21, 2026 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants