Fix winget-publish CI: fall back to new for first-time package submission - #236
Conversation
The wingetcreate update command requires the package to already exist in microsoft/winget-pkgs. For first-time submissions, fall back to wingetcreate new. Also add generated 2.18.0 manifests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
📝 WalkthroughWalkthroughAdds fallback logic in the WinGet CI submission step to run Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7027e3891b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .\wingetcreate.exe new $url ` | ||
| --version $version ` | ||
| --submit ` | ||
| --token ${{ secrets.WINGET_TOKEN }} |
There was a problem hiding this comment.
Use a non-interactive command for first-time WinGet publish
When update fails, this fallback calls wingetcreate.exe new with --version/--submit, but new is an interactive wizard command (not the CI-oriented update flow), so in CI it can fail on unsupported args or block waiting for prompts. In the exact first-submission case this change targets, the job still won’t reliably create/submit a manifest PR automatically.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/deploy.yml:
- Around line 1647-1658: The fallback invocation of wingetcreate.exe new uses
unsupported flags (--version and --submit) which will cause it to fail; update
the fallback call for the new command (wingetcreate.exe new) to only pass
supported options: the package URL (positional), the token (--token or -t) and
optionally --no-open (-n) or --out (-o) if needed, removing --version and
--submit so the first-time submission can succeed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 2b0880e1-7c53-4c64-937c-977c7d5b7023
📒 Files selected for processing (4)
.github/workflows/deploy.ymlwinget/manifests/f/FernandoTonon/QtMeshEditor/2.18.0/FernandoTonon.QtMeshEditor.installer.yamlwinget/manifests/f/FernandoTonon/QtMeshEditor/2.18.0/FernandoTonon.QtMeshEditor.locale.en-US.yamlwinget/manifests/f/FernandoTonon/QtMeshEditor/2.18.0/FernandoTonon.QtMeshEditor.yaml
| # Try 'update' first (package already in winget-pkgs); fall back to 'new' for first submission | ||
| $result = .\wingetcreate.exe update FernandoTonon.QtMeshEditor ` | ||
| --version $version ` | ||
| --urls $url ` | ||
| --submit ` | ||
| --token ${{ secrets.WINGET_TOKEN }} | ||
| if ($LASTEXITCODE -ne 0) { | ||
| .\wingetcreate.exe new $url ` | ||
| --version $version ` | ||
| --submit ` | ||
| --token ${{ secrets.WINGET_TOKEN }} | ||
| } |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify workflow usage vs documented 'new' arguments
rg -n -C2 'wingetcreate\.exe (update|new)|--version|--submit' .github/workflows/deploy.yml
# Check official 'new' command docs for available args
curl -sL https://raw.githubusercontent.com/microsoft/winget-create/main/doc/new.md \
| rg -n '## Usage|## Arguments|--version|--submit|-t, --token|-o, --out|-n, --no-open'Repository: fernandotonon/QtMeshEditor
Length of output: 4025
wingetcreate new fallback uses unsupported flags that will cause the command to fail.
Lines 1655 (--version) and 1656 (--submit) are not valid arguments for the new command according to the official winget-create documentation. The new command only supports -o, --out, -t, --token, and -n, --no-open. Remove these unsupported flags to allow the fallback to handle first-time package submissions correctly.
Suggested fix
if ($LASTEXITCODE -ne 0) {
.\wingetcreate.exe new $url `
- --version $version `
- --submit `
--token ${{ secrets.WINGET_TOKEN }}
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # Try 'update' first (package already in winget-pkgs); fall back to 'new' for first submission | |
| $result = .\wingetcreate.exe update FernandoTonon.QtMeshEditor ` | |
| --version $version ` | |
| --urls $url ` | |
| --submit ` | |
| --token ${{ secrets.WINGET_TOKEN }} | |
| if ($LASTEXITCODE -ne 0) { | |
| .\wingetcreate.exe new $url ` | |
| --version $version ` | |
| --submit ` | |
| --token ${{ secrets.WINGET_TOKEN }} | |
| } | |
| # Try 'update' first (package already in winget-pkgs); fall back to 'new' for first submission | |
| $result = .\wingetcreate.exe update FernandoTonon.QtMeshEditor ` | |
| --version $version ` | |
| --urls $url ` | |
| --submit ` | |
| --token ${{ secrets.WINGET_TOKEN }} | |
| if ($LASTEXITCODE -ne 0) { | |
| .\wingetcreate.exe new $url ` | |
| --token ${{ secrets.WINGET_TOKEN }} | |
| } |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.github/workflows/deploy.yml around lines 1647 - 1658, The fallback
invocation of wingetcreate.exe new uses unsupported flags (--version and
--submit) which will cause it to fail; update the fallback call for the new
command (wingetcreate.exe new) to only pass supported options: the package URL
(positional), the token (--token or -t) and optionally --no-open (-n) or --out
(-o) if needed, removing --version and --submit so the first-time submission can
succeed.
wingetcreate new does not accept --version or --urls flags; the installer URL is passed positionally and the version is inferred from the installer. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
♻️ Duplicate comments (1)
.github/workflows/deploy.yml (1)
1654-1658:⚠️ Potential issue | 🟠 MajorRemove unsupported
--submitfromwingetcreate new.At Line 1656,
newis invoked with--submit. In current winget-create docs,newsupports--tokenbut not--submit, so fallback can fail for first-time submissions.Proposed fix
if ($LASTEXITCODE -ne 0) { # 'new' does not support --version or --urls; pass URL positionally .\wingetcreate.exe new $url ` - --submit ` --token ${{ secrets.WINGET_TOKEN }} }#!/bin/bash set -euo pipefail # Verify allowed args for 'new' curl -sL https://raw.githubusercontent.com/microsoft/winget-create/main/doc/new.md \ | rg -n '## Usage|## Arguments|--submit|--token|-n, --no-open|-o, --out' # Verify '--submit' support on 'update' curl -sL https://raw.githubusercontent.com/microsoft/winget-create/main/doc/update.md \ | rg -n '## Usage|## Arguments|--submit'🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/deploy.yml around lines 1654 - 1658, The workflow invokes "wingetcreate.exe new" with an unsupported "--submit" flag (the command is called in the block containing ".\wingetcreate.exe new $url ` --submit ` --token ${{ secrets.WINGET_TOKEN }}"), so remove the "--submit" token from that invocation and leave the URL passed positionally and the "--token" option intact; ensure the call becomes ".\wingetcreate.exe new $url ` --token ${{ secrets.WINGET_TOKEN }}" so first-time submissions don't fail due to the unsupported flag.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In @.github/workflows/deploy.yml:
- Around line 1654-1658: The workflow invokes "wingetcreate.exe new" with an
unsupported "--submit" flag (the command is called in the block containing
".\wingetcreate.exe new $url ` --submit ` --token ${{ secrets.WINGET_TOKEN }}"),
so remove the "--submit" token from that invocation and leave the URL passed
positionally and the "--token" option intact; ensure the call becomes
".\wingetcreate.exe new $url ` --token ${{ secrets.WINGET_TOKEN }}" so
first-time submissions don't fail due to the unsupported flag.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 650b9c0c-df84-4ad0-8667-844f253e262f
📒 Files selected for processing (1)
.github/workflows/deploy.yml
There was a problem hiding this comment.
♻️ Duplicate comments (1)
.github/workflows/deploy.yml (1)
1655-1658:⚠️ Potential issue | 🟠 MajorRemove unsupported
--submitfromwingetcreate new.Line 1657 still passes
--submittonew. In the officialwinget-createdocs,newsupports--token,--out, and--no-open, but not--submit; this can still break the first-time fallback path.Suggested fix
if ($LASTEXITCODE -ne 0) { # 'new' does not support --version or --urls; pass URL positionally .\wingetcreate.exe new $url ` - --submit ` - --token ${{ secrets.WINGET_TOKEN }} + --token ${{ secrets.WINGET_TOKEN }} ` + --no-open }#!/bin/bash set -euo pipefail echo "Current workflow usage:" rg -n -C2 'wingetcreate\.exe (update|new)|--submit|--version|--urls|--token' .github/workflows/deploy.yml echo echo "Official new command args (should NOT include --submit):" curl -fsSL https://raw.githubusercontent.com/microsoft/winget-create/main/doc/new.md \ | rg -n -- '## Usage|## Arguments|--submit|-o, --out|-t, --token|-n, --no-open' echo echo "Official update command args (does include --submit):" curl -fsSL https://raw.githubusercontent.com/microsoft/winget-create/main/doc/update.md \ | rg -n -- '## Usage|## Arguments|--submit'🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/deploy.yml around lines 1655 - 1658, The workflow invokes "wingetcreate.exe new $url" but incorrectly passes the unsupported flag "--submit"; remove the "--submit" token from the "wingetcreate.exe new $url" command so the "new" subcommand uses only supported args (e.g., --token, --out, --no-open) while leaving any "wingetcreate.exe update" usages that require --submit unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In @.github/workflows/deploy.yml:
- Around line 1655-1658: The workflow invokes "wingetcreate.exe new $url" but
incorrectly passes the unsupported flag "--submit"; remove the "--submit" token
from the "wingetcreate.exe new $url" command so the "new" subcommand uses only
supported args (e.g., --token, --out, --no-open) while leaving any
"wingetcreate.exe update" usages that require --submit unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 75b64b2e-aece-4888-b151-062d005e5c80
📒 Files selected for processing (1)
.github/workflows/deploy.yml
|



Summary
wingetcreate updatefails when the package has never been merged into winget-pkgs (exits code 1: "package not found"). Added a fallback towingetcreate newso the first submission works automatically.Test plan
winget-publishsuccessfully🤖 Generated with Claude Code
Summary by CodeRabbit