Automate Microsoft Store listing updates - #34
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b48942023f
ℹ️ 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".
| $nonScreenshotImages = @($baseListing.Images | | ||
| Where-Object { [string]$_.ImageType -ne "Screenshot" }) |
There was a problem hiding this comment.
Mark prior screenshots for deletion before adding replacements
When the draft is cloned from an existing published submission, BaseListing.Images contains the currently published screenshots. Filtering those objects out of the PUT payload does not request their removal; the Store submission API uses FileStatus = "PendingDelete" for that operation. Consequently, synchronization can retain stale screenshots alongside the new set, eventually exceeding the screenshot limit or publishing outdated images. Preserve the existing screenshot entries and mark them pending deletion before appending the replacements.
Useful? React with 👍 / 👎.
| [IO.Path]::GetExtension($fileName) -ine ".png" -or | ||
| [IO.Path]::GetFileName($fileName) -ne $fileName) { |
There was a problem hiding this comment.
Validate the source image encoding instead of its target name
When a manifest points Source at a JPEG, GIF, or renamed non-PNG image while giving it a .png FileName, this check passes and Image.FromFile also loads the asset successfully. The script then copies the original bytes under a PNG filename, so CI's advertised PNG validation succeeds but the Store upload can receive an incorrectly encoded asset and reject the submission. Check RawFormat or the source signature, or explicitly transcode it to PNG.
Useful? React with 👍 / 👎.
Summary
Safety
Verification
./tools/SyncStoreListing.ps1 -Version 0.2.1 -ValidateOnly./tools/New-StoreListingScreenshots.ps1dotnet build ./Captail.sln -c Release --no-restore -p:ContinuousIntegrationBuild=true