Skip to content

Commit c34f00a

Browse files
committed
ci(release): treat winget validate warnings as success
1 parent 0858add commit c34f00a

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,24 @@ jobs:
927927
exit 0
928928
}
929929
930-
& $winget.Source validate --manifest "${{ steps.winget_manifest.outputs.manifest_dir }}" --disable-interactivity
930+
$output = & $winget.Source validate --manifest "${{ steps.winget_manifest.outputs.manifest_dir }}" --disable-interactivity 2>&1
931+
$exit = $LASTEXITCODE
932+
$output | ForEach-Object { Write-Host $_ }
933+
934+
if ($exit -eq 0) {
935+
exit 0
936+
}
937+
938+
# `winget validate` returns a non-zero exit code even when the manifest
939+
# is valid but produced warnings (e.g., the runner's winget predates the
940+
# 1.12.0 schema URL pattern). Treat that case as success; the winget-pkgs
941+
# bot performs authoritative validation when the PR is opened.
942+
if (($output -join "`n") -match 'Manifest validation succeeded with warnings\.') {
943+
Write-Host "::notice::winget validate reported only warnings; continuing."
944+
exit 0
945+
}
946+
947+
exit $exit
931948
932949
- name: Submit package to WinGet
933950
shell: pwsh

0 commit comments

Comments
 (0)