Fix release workflow: broken regex and fragile multiline handling for bump detection#6
Conversation
…tection The regex `\[xX\]` matched the literal string `[xX]` instead of `[x]` or `[X]`. Changed to `\[[xX]\]` which uses a character class. Additionally, PR body is now written to a temp file and checkbox lines are extracted between <!--changelog-type-start--> / <!--changelog-type-end--> markers with awk before grepping, ensuring multiline content is preserved. Co-authored-by: nilsandrey <3579285+nilsandrey@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the release GitHub Actions workflow to correctly detect the selected version-bump checkbox in merged PR bodies, making bump detection more reliable for multiline PR descriptions.
Changes:
- Fix the checkbox-regex so
[x]/[X]are matched correctly in ERE. - Persist the PR body to a temp file and write it to
GITHUB_OUTPUTviacatto preserve multiline content. - Restrict bump detection to the section between
<!--changelog-type-start-->and<!--changelog-type-end-->markers.
…ssing Replace `echo "$CHECKBOX_LINES" | grep` with `grep <<< "$CHECKBOX_LINES"` to avoid implementation-defined echo behavior. Also fall back to scanning the full PR body with a warning when changelog-type markers are absent. Co-authored-by: nilsandrey <3579285+nilsandrey@users.noreply.github.com>
|
@copilot Update this PR description to have the expected sections for the Release pipeline used to update changelog and release I think. DescriptionType of Change
|
... Updated the PR description with the expected |
Description
Fix release workflow bump detection: correct broken regex (
\[xX\]→\[[xX]\]), use temp file +awkmarkers for reliable multiline PR body handling, replaceecho | grepwith here-strings, and fall back to full-body scan when markers are missing.Type of Change
Details
Release workflow fails to detect checked version-bump checkbox (run #22827290539), even when
- [x] **Patch**is clearly present in the PR body.Broken regex
\[xX\]in ERE matches the literal 4-char string[xX], not[x]or[X]:Fragile multiline handling
printfto reliably preserve newlines regardless of shell behavior<!--changelog-type-start-->/<!--changelog-type-end-->markers withawkbefore grepping, avoiding false matches from other sections::warning::annotation instead of failing with a misleading errorRobust grep usage
echo "$VAR" | grepwith here-strings (grep ... <<< "$VAR") to avoidecho's implementation-defined behavior with certain leading characters and escape sequences💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.