Fix changelog grab failure when only one header exists. by jshigetomi · Pull Request #27371 · PowerShell/PowerShell
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Conversation
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
$headingStartLinesis 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
- PR has a meaningful title
- Use the present tense and imperative mood when describing your changes
- Summarized changes
- Make sure all
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright header - This PR is ready to merge. If this PR is a work in progress, please open this as a Draft Pull Request and mark it as Ready to Review when it is ready to merge.
- Breaking changes
- None
- OR
- Experimental feature(s) needed
- Experimental feature name(s):
- User-facing changes
- Not Applicable
- OR
- Documentation needed
- Issue filed:
- Testing - New and feature
- N/A or can only be tested interactively
- OR
- Make sure you've added a new test if existing tests do not effectively test the code changed
Copilot AI review requested due to automatic review settings
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
$headingStartLinesis 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.
JustinGrote pushed a commit to JustinGrote/PowerShell that referenced this pull request
…7371) Co-authored-by: Justin Chung <chungjustin@microsoft.com>