Skip to content

Fix changelog grab failure when only one header exists.#27371

Merged
jshigetomi merged 1 commit intoPowerShell:masterfrom
jshigetomi:fixGitHubTaskCL
Apr 28, 2026
Merged

Fix changelog grab failure when only one header exists.#27371
jshigetomi merged 1 commit intoPowerShell:masterfrom
jshigetomi:fixGitHubTaskCL

Conversation

@jshigetomi
Copy link
Copy Markdown
Collaborator

@jshigetomi jshigetomi commented Apr 28, 2026

PR Summary

This pull request improves the robustness of the changelog extraction logic in the .pipelines/templates/release-githubNuget.yml pipeline script. The script now handles cases where there may be only one release heading in the changelog and provides a clear error if no headings are found.

Changelog extraction improvements:

  • Ensured that $headingStartLines is always an array and added a check to throw an error if no release heading matching the expected pattern is found in the changelog file.
  • Updated the logic to correctly handle changelogs with only one release heading by extracting content through the end of the file, and fixed the calculation of the number of lines to extract.

PR Context

This unblocks 7.7.0-preview.1 github release

PR Checklist

@jshigetomi jshigetomi added the CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log label Apr 28, 2026
@jshigetomi jshigetomi marked this pull request as ready for review April 28, 2026 17:11
@jshigetomi jshigetomi requested a review from a team as a code owner April 28, 2026 17:11
Copilot AI review requested due to automatic review settings April 28, 2026 17:11
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

Improves changelog section extraction in the GitHub release/NuGet publish pipeline template so it works when the changelog contains only a single release heading, and fails fast with a clear error when no headings are found.

Changes:

  • Ensures $headingStartLines is always an array and throws an explicit error when no matching release headings are present.
  • Adjusts end-of-section detection to handle single-heading changelogs by extracting through EOF.
  • Fixes the extracted line count calculation to include the intended final line.

@jshigetomi jshigetomi merged commit d356e3f into PowerShell:master Apr 28, 2026
52 of 54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants