release-winget: fix PR URL extraction in notice#887
Merged
dscho merged 1 commit intovfs-2.53.0from Apr 17, 2026
Merged
Conversation
The notice at the end of a successful winget submission says "Submitted v2.53.0.vfs.0.7 to winget as h" instead of printing the full PR URL. This was visible in https://github.com/microsoft/git/actions/runs/24558034627 (run attempt 2, which succeeded after manually syncing the fork). The root cause is a PowerShell quirk: when Select-String produces exactly one match, ForEach-Object { $_.Matches.Value } emits a single string rather than a one-element array. The trailing [0] then indexes into that string, returning its first character "h" (from "https://...") instead of the first array element. PR #843 (which tightened the regex from 'https://\S+' to the full winget-pkgs URL pattern) inherited this [0] from the original code, where $output was an array of lines and [0] picked the first line's match. After the PR #843 change to pass -t via environment variable, wingetcreate's output arrives as a single string, so [0] now indexes into the string itself. Fix by simply dropping the [0], since the tightened regex can only match the one URL we care about anyway. Assisted-by: Claude Opus 4.6 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
mjcheetham
approved these changes
Apr 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The notice at the end of a successful winget submission says
Submitted v2.53.0.vfs.0.7 to winget as hinstead of the full PR URL. Visible in https://github.com/microsoft/git/actions/runs/24558034627 (run attempt 2).The root cause is a PowerShell quirk: when
Select-Stringproduces exactly one match,ForEach-Object { $_.Matches.Value }emits a single string rather than a one-element array. The trailing[0]then indexes into that string's characters, returningh(the first char ofhttps://...).Fix by dropping the
[0], since the tightened regex (from PR #843) can only match the one URL we care about.