Skip to content

release-winget: fix PR URL extraction in notice#887

Merged
dscho merged 1 commit intovfs-2.53.0from
fix-winget-url-notice
Apr 17, 2026
Merged

release-winget: fix PR URL extraction in notice#887
dscho merged 1 commit intovfs-2.53.0from
fix-winget-url-notice

Conversation

@dscho
Copy link
Copy Markdown
Member

@dscho dscho commented Apr 17, 2026

The notice at the end of a successful winget submission says Submitted v2.53.0.vfs.0.7 to winget as h instead 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-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's characters, returning h (the first char of https://...).

Fix by dropping the [0], since the tightened regex (from PR #843) can only match the one URL we care about.

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>
@dscho dscho self-assigned this Apr 17, 2026
@dscho dscho requested a review from mjcheetham April 17, 2026 12:00
@dscho dscho marked this pull request as ready for review April 17, 2026 12:00
@dscho dscho enabled auto-merge April 17, 2026 12:01
@dscho dscho merged commit d278387 into vfs-2.53.0 Apr 17, 2026
169 checks passed
@dscho dscho deleted the fix-winget-url-notice branch April 17, 2026 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants