Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion .github/workflows/winget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,26 @@ jobs:
.\wingetcreate.exe update $packageId `
--version $packageVersion `
--urls "$installerUrlx64|x64" "$installerUrlarm64|arm64" `
--submit
--out manifests

# Add PowerShell dependency to installer manifest
$installerManifest = Get-ChildItem -Path manifests -Filter "*.installer.yaml" -Recurse | Select-Object -First 1 -ExpandProperty FullName
if (-not $installerManifest) {
Write-Error "No installer manifest (*.installer.yaml) was found in the 'manifests' directory."
exit 1
}
$content = Get-Content -Path $installerManifest -Raw
$dependency = @"
Dependencies:
PackageDependencies:
- PackageIdentifier: Microsoft.PowerShell
MinimumVersion: "7.0.0"
"@
# Remove existing top-level Dependencies block (if any), then insert ours
$content = $content -replace '(?m)^Dependencies:\r?\n([ ]+.+\r?\n)*', ''
$content = $content -replace '(?m)^Installers:', "$dependency`nInstallers:"
Set-Content -Path $installerManifest -Value $content
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set-Content is called without an explicit encoding. PowerShell’s default encoding differs between hosts/versions, which can produce manifests in an unexpected encoding and potentially break submission tooling. Consider setting -Encoding utf8 (and, if needed, preserving the original line endings).

Suggested change
Set-Content -Path $installerManifest -Value $content
Set-Content -Path $installerManifest -Value $content -Encoding utf8

Copilot uses AI. Check for mistakes.

# Submit the modified manifest
$manifestPath = Split-Path $installerManifest
.\wingetcreate.exe submit $manifestPath