Enable WinGet installation method for Windows, replace Scoop references#473
Enable WinGet installation method for Windows, replace Scoop references#473
Conversation
- README.md: replace Scoop with winget install Microsoft.APM - docs/getting-started/installation.md: replace Scoop with WinGet - docs/getting-started/quick-start.md: update Scoop -> WinGet reference - build-release.yml: convert update-scoop to update-winget job, remove false && guard, target microsoft/winget-apm - CHANGELOG.md: add entry for WinGet support Agent-Logs-Url: https://github.com/microsoft/apm/sessions/1e22f536-960f-43c1-8553-6094a4dcf11f Co-authored-by: danielmeppiel <51440732+danielmeppiel@users.noreply.github.com>
|
@copilot we have no such repo winget-apm. It's microsoft/winget-pkgs. If we want to auto-update the version there, we need to open a PR on it automatically and update the manifest there, example PR for another pkg is: microsoft/winget-pkgs#352862 . Assess how to do this properly and refactor accordingly. |
Replace custom repository-dispatch to nonexistent microsoft/winget-apm with the community-standard winget-releaser action that opens PRs directly to microsoft/winget-pkgs using Komac. Requires: - WINGET_TOKEN secret (classic PAT with public_repo scope) - Fork of microsoft/winget-pkgs under the repo owner account Agent-Logs-Url: https://github.com/microsoft/apm/sessions/5bda2f76-d19a-491c-8a2d-2b4ce24960b8 Co-authored-by: danielmeppiel <51440732+danielmeppiel@users.noreply.github.com>
Refactored in 6738a43. Replaced the Setup required before first use:
|
danielmeppiel
left a comment
There was a problem hiding this comment.
Review — Supply Chain & Operational Concerns
The docs changes (Scoop → WinGet) are great. But the CI workflow has significant trust and operational gaps that need addressing before merge.
🔴 Critical: Supply chain trust of vedantmgoyal9/winget-releaser@v2
This is a single individual's community action (284 stars, AGPL-3.0) being used in a Microsoft org repo to push PRs to another Microsoft repo (microsoft/winget-pkgs). Three compounding risks:
- Mutable
@v2tag — points to a commit that can be force-pushed at any time. The action code could change without notice. - Transitive supply chain — the action itself pulls
cargo-bins/cargo-binstall@main(pinned tomain!) to download thekomacRust binary at runtime. That's two layers of mutable, unaudited dependencies installing and running arbitrary binaries with your PAT. - Token exposure —
WINGET_TOKEN(classic PAT withpublic_reposcope) is passed asGITHUB_TOKENenv var tokomac. A compromised action or Komac binary has fullpublic_repoaccess. - Zero Microsoft org adoption — no other
microsoft/*repo uses this action in their workflows.
Recommendation: Use Microsoft's own wingetcreate tool (microsoft/winget-create, MIT, 618 stars). It's the official Windows Package Manager Manifest Creator. Example:
steps:
- name: Update WinGet manifest
run: |
iwr https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
.\wingetcreate.exe update Microsoft.APM `
--version ${{ github.ref_name }} `
--urls "https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/apm-windows-x86_64.zip" `
--submit --token ${{ secrets.WINGET_TOKEN }}
shell: pwsh
runs-on: windows-latest # wingetcreate requires WindowsIf wingetcreate is not viable (e.g., you need Linux runners), at minimum pin winget-releaser to a full SHA rather than @v2:
uses: vedantmgoyal9/winget-releaser@4ffc7888bffd451b357355dc214d43bb9f23917e # v2🔴 Critical: Fork ownership problem
The action defaults fork-user to ${{ github.repository_owner }}, which is microsoft. But microsoft/winget-pkgs already exists — you cannot fork a repo into the same org that owns it. This means:
- As-is, the workflow will fail at runtime (Komac cannot create a fork under
microsoft) - You need a separate bot/service account that owns a fork of
winget-pkgs - The
fork-userinput must be explicitly set to that account
This is not called out in the workflow and would be a silent runtime failure on first release.
🟡 Medium: Token scope & naming
WINGET_TOKENneedspublic_reposcope on a classic PAT. Fine-grained tokens won't work for cross-repo fork PRs. This should be documented in a comment in the workflow.- The old
GH_PKG_PATsecret is removed — confirm it's no longer needed by any other workflow before cleanup.
🟢 Docs changes look good
The Scoop → WinGet swap across README, installation guide, quick-start, and CHANGELOG is clean and correct.
Summary
| Finding | Severity | Action |
|---|---|---|
| Untrusted community action with mutable tags + transitive deps | Critical | Use wingetcreate or pin to SHA |
Fork-user defaults to microsoft — will fail at runtime |
Critical | Configure bot account fork + set fork-user |
| Token scope/docs | Medium | Add workflow comment documenting requirements |
| Docs changes | ✅ | Good to go |
Address supply chain trust concerns by replacing the third-party community action with Microsoft's official wingetcreate tool: - Use windows-latest runner (wingetcreate requires Windows) - Download wingetcreate.exe from official aka.ms/wingetcreate/latest - Run wingetcreate update --submit to open PRs to microsoft/winget-pkgs - Strip v prefix from tag for WinGet version format - Document WINGET_TOKEN requirements in workflow comments - Eliminates fork ownership issues (wingetcreate handles internally) Agent-Logs-Url: https://github.com/microsoft/apm/sessions/26010ddd-2ae4-47e5-af28-2c05fafe62ec Co-authored-by: danielmeppiel <51440732+danielmeppiel@users.noreply.github.com>
Addressed all findings in 526d9cf. Replaced
|
There was a problem hiding this comment.
Pull request overview
Updates Windows installation guidance to use WinGet now that Microsoft.APM is available in winget-pkgs, and enables an automated release-time workflow job to submit WinGet manifest updates upstream.
Changes:
- Replace Scoop-based Windows install instructions with
winget install Microsoft.APMin README and Starlight docs. - Update Quick Start copy to reference WinGet instead of Scoop.
- Re-enable the previously-disabled package-manager update job as
update-wingetusingwingetcreateon a Windows runner.
Show a summary per file
| File | Description |
|---|---|
| README.md | Switches Windows package-manager instructions from Scoop to WinGet. |
| docs/src/content/docs/getting-started/quick-start.md | Updates Quick Start text to reference WinGet for Windows. |
| docs/src/content/docs/getting-started/installation.md | Replaces Scoop section with WinGet commands in the installation guide. |
| .github/workflows/build-release.yml | Adds/enables update-winget job to generate and submit WinGet manifest updates on stable tags. |
Copilot's findings
Comments suppressed due to low confidence (1)
README.md:82
- For reliable, non-interactive installs, prefer using the package id explicitly (e.g.,
winget install --id Microsoft.APM). Using only the query string can become ambiguous if similarly named packages appear and can prompt for selection.
```powershell
# WinGet
winget install Microsoft.APM
# pip
- Files reviewed: 4/4 changed files
- Comments generated: 5
| #### Windows | ||
|
|
||
| ```powershell | ||
| # Scoop | ||
| scoop bucket add apm https://github.com/microsoft/scoop-apm | ||
| scoop install apm | ||
| # WinGet | ||
| winget install Microsoft.APM | ||
| # pip | ||
| pip install apm-cli | ||
| ``` |
There was a problem hiding this comment.
README updates require explicit maintainer approval in this repo. Before merging, please confirm the README.md change is intended and approved (otherwise move this guidance into the docs pages only).
This issue also appears on line 79 of the same file.
See below for a potential fix:
Install instructions are maintained in the docs to keep this README concise.
See the **[Quick Start](https://microsoft.github.io/apm/getting-started/quick-start/)** for supported installation methods on Linux, macOS, and Windows.
| **WinGet (Windows):** | ||
|
|
||
| ```powershell | ||
| scoop bucket add apm https://github.com/microsoft/scoop-apm | ||
| scoop install apm | ||
| winget install Microsoft.APM | ||
| ``` |
There was a problem hiding this comment.
This PR updates Starlight docs to WinGet, but the in-repo usage docs under packages/apm-guide/.apm/skills/apm-usage/installation.md still reference Scoop. Please update that file too so generated guidance stays consistent with the main installation docs.
| ```powershell | ||
| scoop bucket add apm https://github.com/microsoft/scoop-apm | ||
| scoop install apm | ||
| winget install Microsoft.APM |
There was a problem hiding this comment.
Consider using the explicit WinGet id form here as well (winget install --id Microsoft.APM) to avoid ambiguity and interactive prompts if the search term ever matches multiple packages.
| winget install Microsoft.APM | |
| winget install --id Microsoft.APM |
| # Update WinGet package at microsoft/winget-pkgs (only stable releases from public repo) | ||
| # Uses Microsoft's official wingetcreate tool (https://github.com/microsoft/winget-create) | ||
| # to generate updated manifests and open a PR to microsoft/winget-pkgs. | ||
| # Requires WINGET_TOKEN secret: classic PAT with public_repo scope. | ||
| update-winget: | ||
| name: Update WinGet Package | ||
| runs-on: windows-latest | ||
| needs: [build-and-test, build-and-validate-macos-intel, build-and-validate-macos-arm, integration-tests, release-validation, create-release, publish-pypi] | ||
| # TODO: Enable once downstream repository and secrets are configured (see #88) | ||
| if: false && github.ref_type == 'tag' && needs.create-release.outputs.is_private_repo != 'true' && needs.create-release.outputs.is_prerelease != 'true' | ||
| if: github.ref_type == 'tag' && needs.create-release.outputs.is_private_repo != 'true' && needs.create-release.outputs.is_prerelease != 'true' |
There was a problem hiding this comment.
PR description says CHANGELOG is updated under Unreleased, but there is currently no WinGet-related entry in CHANGELOG.md. Please add the Unreleased changelog entry (or update the PR description if that work is intentionally out of scope).
| $version = "${{ github.ref_name }}" -replace '^v', '' | ||
| $url = "https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/apm-windows-x86_64.zip" | ||
| Invoke-WebRequest -Uri "https://aka.ms/wingetcreate/latest" -OutFile wingetcreate.exe | ||
| .\wingetcreate.exe update Microsoft.APM ` | ||
| --version $version ` | ||
| --urls $url ` | ||
| --submit ` | ||
| --token ${{ secrets.WINGET_TOKEN }} |
There was a problem hiding this comment.
The workflow downloads wingetcreate from a moving latest URL without any pinning or integrity check. Because this step runs with a PAT that can open PRs to winget-pkgs, it would be safer/more reliable to pin to a specific wingetcreate release (and ideally verify a checksum or signature) to reduce supply-chain and unexpected-breaking-change risk.
Description
WinGet package
Microsoft.APMis now live via winget-pkgs#351674. This PR updates all install docs and enables the CI auto-update job.scoop bucket add/scoop install) withwinget install Microsoft.APMacross README.md, installation guide, and quick-start guideupdate-scoopjob toupdate-winget— uses Microsoft's officialwingetcreatetool (MIT) on awindows-latestrunner to generate updated manifests and open PRs directly tomicrosoft/winget-pkgsSetup required before first use:
WINGET_TOKENrepository secret — classic PAT withpublic_reposcope (documented in workflow comments)Type of change
Testing
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.