◐ Shell
clean mode source ↗

Fix changelog grab failure when only one header exists. by jshigetomi · Pull Request #27371 · PowerShell/PowerShell

Skip to content

Navigation Menu

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Conversation

@jshigetomi

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

Copilot AI review requested due to automatic review settings

April 28, 2026 17:11

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.

daxian-dbw

JustinGrote pushed a commit to JustinGrote/PowerShell that referenced this pull request

Jun 2, 2026
…7371)

Co-authored-by: Justin Chung <chungjustin@microsoft.com>

Labels

CL-BuildPackaging

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

3 participants

@jshigetomi @daxian-dbw