-
Notifications
You must be signed in to change notification settings - Fork 639
Add workflow to automatically submit to Winget #722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,44 @@ | ||||||||||||||||||
| name: Submit release to the WinGet community repository | ||||||||||||||||||
|
|
||||||||||||||||||
| on: | ||||||||||||||||||
| release: | ||||||||||||||||||
| types: [published] | ||||||||||||||||||
|
|
||||||||||||||||||
| jobs: | ||||||||||||||||||
| publish-winget: | ||||||||||||||||||
| name: Submit to WinGet repository | ||||||||||||||||||
|
|
||||||||||||||||||
| # GitHub token permissions needed for winget-create to submit a PR | ||||||||||||||||||
| permissions: | ||||||||||||||||||
| contents: read | ||||||||||||||||||
| pull-requests: write | ||||||||||||||||||
|
|
||||||||||||||||||
| # winget-create is only supported on Windows | ||||||||||||||||||
| runs-on: windows-latest | ||||||||||||||||||
|
|
||||||||||||||||||
|
||||||||||||||||||
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PowerShell conditional expression is incorrect. Using ${{ !github.event.release.prerelease }} inside a PowerShell script will evaluate to a literal string "True" or "False" rather than a PowerShell boolean. This will cause the conditional to always evaluate to true (as non-empty strings are truthy).
Replace with:
$packageId = if ('${{ github.event.release.prerelease }}' -eq 'false') { "GitHub.Copilot" } else { "GitHub.Copilot.Prerelease" }| $packageId = if (${{ !github.event.release.prerelease }}) { "GitHub.Copilot" } else { "GitHub.Copilot.Prerelease" } | |
| $packageId = if ('${{ github.event.release.prerelease }}' -eq 'false') { "GitHub.Copilot" } else { "GitHub.Copilot.Prerelease" } |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The toJSON function is unnecessary here and will add extra quotes around the tag name. The tag_name is already a string, so wrapping it with toJSON() and then assigning it to a PowerShell variable will result in a doubly-quoted string like "v1.0.0" instead of v1.0.0.
Replace with:
$packageVersion = '${{ github.event.release.tag_name }}'| $packageVersion = (${{ toJSON(github.event.release.tag_name) }}) | |
| $packageVersion = '${{ github.event.release.tag_name }}' |
Copilot
AI
Dec 5, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing error handling if the installer URLs are not found. If the asset patterns don't match or the assets are missing, $installerUrlx64 or $installerUrlarm64 will be empty, causing the wingetcreate command to fail with unclear errors.
Consider adding validation:
if ([string]::IsNullOrEmpty($installerUrlx64) -or [string]::IsNullOrEmpty($installerUrlarm64)) {
Write-Error "Failed to find required installer assets"
exit 1
}| # Validate installer URLs | |
| if ([string]::IsNullOrEmpty($installerUrlx64) -or [string]::IsNullOrEmpty($installerUrlarm64)) { | |
| Write-Error "Failed to find required installer assets" | |
| exit 1 | |
| } | |
Uh oh!
There was an error while loading. Please reload this page.