Skip to content

Commit aa30151

Browse files
committed
fixup! Adding winget workflows
I tried to change this workflow before so that it would show the winget PR URL in the workflow run's summary page. But I messed up, not realizing that `wingetcreate.exe submit` would output _multiple_ lines, and therefore simply prefixing the output with `::notice::...` would only elevate the first line of that output to the run's summary page (and naturally, the PR URL is not part of that). Bite the bullet and parse the output to extract the URL, and then show that as intended. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 6cfbd84 commit aa30151

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

.github/workflows/release-winget.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ jobs:
7878
7979
# Submit the manifest to the winget-pkgs repository
8080
$manifestDirectory = "$PWD\manifests\m\Microsoft\Git\$version"
81-
Write-Host -NoNewLine "::notice::Submitting ${env:TAG_NAME} to winget... "
82-
.\wingetcreate.exe submit -t "$(Get-Content token.txt)" $manifestDirectory
81+
$output = & .\wingetcreate.exe submit -t "$(Get-Content token.txt)" $manifestDirectory
82+
Write-Host $output
83+
$url = ($output | Select-String -Pattern 'https://\S+' | ForEach-Object { $_.Matches.Value })[0]
84+
Write-Host "::notice::Submitted ${env:TAG_NAME} to winget as $url"
8385
shell: powershell

0 commit comments

Comments
 (0)