Repository navigation
Verify the gh download in both release stages, and bump it to 2.97.0 - #748
Conversation
The release pipeline installs the GitHub CLI in two stages from the same URL, but only one of them checked the download. Release_MSLearn verified a SHA-256 and failed the build on mismatch; Release_WinGet downloaded and extracted the zip unchecked. The URL and hash are now declared once as pipeline variables and referenced from both stages, so they cannot drift apart -- which is the failure mode that produced the inconsistency, and the one the "get the latest version of gh" TODO would have walked straight into. Bumped 2.83.1 -> 2.97.0 while here. The pinned hash is the value published in gh_2.97.0_checksums.txt, confirmed against a SHA-256 computed from an independent download of the asset.
There was a problem hiding this comment.
Pull request overview
Centralizes and verifies the GitHub CLI dependency used by production release stages.
Changes:
- Bumps GitHub CLI from 2.83.1 to 2.97.0.
- Shares the download URL and verified SHA-256.
- Adds integrity validation to the WinGet release stage.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Build Metrics ReportBinary Sizes
Test Results✅ 4562 passed, 5 skipped out of 4567 tests in 640.8s (+2.1s vs. baseline) Test Coverage✅ 89.1% line coverage, 82.4% branch coverage · ✅ no change vs. baseline CLI Startup Time48ms median (x64, Try This BuildInstalls the MSIX for your architecture, replacing any previously installed build. Needs the GitHub CLI — the command offers to install it and sign you in if it is missing. & ([scriptblock]::Create((irm https://raw.githubusercontent.com/microsoft/winappCli/main/scripts/winapp-pr.ps1))) 748Switching between builds often?Put the tool on your PATH once: & ([scriptblock]::Create((irm https://raw.githubusercontent.com/microsoft/winappCli/main/scripts/winapp-pr.ps1))) -AddToPathThen this build is just: winapp-pr 748Run Updated 2026-08-13 18:39:33 UTC · commit |
5891085
into
main
Problem
.pipelines/release.ymlinstalls the GitHub CLI in two stages from the same URL, and only one of them checked what it downloaded:Release_MSLearn(line ~493)Release_WinGet(line ~405)The unverified copy then runs
gh.exe repo syncagainst the winget-pkgs fork using a GitHub token, inside a production release. Same URL, same version, two different standards.Both stages also hardcoded the URL and (where present) the hash independently, which is what let them diverge in the first place. The
# TODO: Change this to get the latest version of ghsitting directly above the unverified copy would have walked into the same trap again — bump one site, miss the other, and the two stages silently run differentghversions.Change
The URL and its hash are declared once as pipeline variables and referenced from both stages:
Both stages now perform the same
Get-FileHashcheck and fail the build on mismatch. The comment records where the hash comes from, so the next bump is a two-line edit with an obvious source of truth — which is the actual resolution of that TODO.Version bump
2.83.1 → 2.97.0 (latest, published 2026-07-31). The pinned hash was established two ways before being written down:
Validation
.pipelines/release.ymlparses (ConvertFrom-Yaml); top-level keys and all stages intact —Build,Release_GitHub,Release_Npm/Release_NuGet(conditional),Release_WinGet,Release_MSLearn. The URL and hash literals each appear exactly once, in the variables block.I cannot execute an ADO pipeline run from here, so the behavioural check is limited to that: YAML validity, and both call sites resolving the same two variables.
Context
From the audit for "Production builds must only consume dependencies from approved sources". This is a genuine production-path finding — unlike the ones I raised against the GitHub Actions workflows, which are the external-contributor build and are explicitly permitted to use public registries. Separately still open: whether a GitHub-published binary from the
cliorg counts as an approved source at all, which needs confirmation rather than a code change.