fix(ci): harden workflows#310
Merged
ruturaj-browserstack merged 4 commits intoMay 29, 2026
Merged
Conversation
Workflow inherited the write-all default for GITHUB_TOKEN. Limits to read-only — the job only checks out the repo and runs npm test, no write access to any GitHub resource is needed. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Adds --provenance to the npm publish step and the required id-token: write permission. Attaches a signed attestation to the published package so consumers can verify it was built by this exact workflow on this repo. Defends against trojaned releases via a compromised maintainer machine or NPM_TOKEN. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Previous install step piped curl output straight to tar — any compromise of the release URL (CDN, account, MITM) would have executed arbitrary code with OIDC write access. Now: download to file, verify SHA-256 against pinned digest, then extract. Workflow aborts on mismatch. Pinned to mcp-publisher v1.3.3 linux_amd64 (digest cross-checked against the official registry_1.3.3_checksums.txt file). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
ruturaj-browserstack
previously approved these changes
May 29, 2026
ruturaj-browserstack
approved these changes
May 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three independent workflow hardening fixes.
Changes
1.
mcp-ci.yml— least-privilege permissionsAdded top-level
permissions: contents: read. The CI workflow previously inherited the write-alldefault for
GITHUB_TOKEN; it only needs to check out the repo and runnpm test.2.
npm-publish.yml— npm provenanceAdded
--provenanceto thenpm publishcommand and the requiredid-token: writepermission.Released packages now carry a signed attestation linking the tarball to this workflow run on this
repo — defends against trojaned releases via a leaked
NPM_TOKENor compromised maintainer machine.Verifiable by consumers via
npm audit signatures.3.
mcp-registry-publish.yml— SHA-verify themcp-publisherbinaryReplaced
curl … | tar xzwith download →sha256sum -c→ extract. Pinned tomcp-publisherv1.3.3 linux_amd64; digest cross-checked against the official
registry_1.3.3_checksums.txt.Workflow aborts if the downloaded tarball doesn't match.