Skip to content

Commit a037e75

Browse files
committed
Verify pkg.pr.new tarball sha256 before npx and drop the do-not-merge guard
Adds a fetch-and-verify step to both jobs: when CONFORMANCE_PKG is a URL, download the tarball, check it against CONFORMANCE_PKG_SHA256, and re-point CONFORMANCE_PKG at the verified local file. No-op for registry specs (npm's own integrity applies).
1 parent 6182ccd commit a037e75

1 file changed

Lines changed: 25 additions & 3 deletions

File tree

.github/workflows/conformance.yml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ env:
2020
# .github/actions/conformance/expected-failures*.yml files in the same change.
2121
#
2222
# TODO: replace with @modelcontextprotocol/conformance@0.2.0-alpha.5 once
23-
# https://github.com/modelcontextprotocol/conformance/pull/357 publishes.
24-
# The pkg.pr.new URL below is the preview build of that PR pinned at commit
25-
# 65fcd39 (immutable). Do not merge this branch to main with a pkg.pr.new pin.
23+
# https://github.com/modelcontextprotocol/conformance/pull/357 publishes, and
24+
# drop CONFORMANCE_PKG_SHA256 plus the fetch-and-verify step below.
2625
CONFORMANCE_PKG: "https://pkg.pr.new/@modelcontextprotocol/conformance@65fcd39"
26+
CONFORMANCE_PKG_SHA256: "9a381d7083f8be2fe7ae44efeca54530f18c61425805ddaf9cd88915efcc1574"
2727

2828
jobs:
2929
server-conformance:
@@ -39,6 +39,19 @@ jobs:
3939
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
4040
with:
4141
node-version: 24
42+
- name: Fetch and verify conformance harness
43+
# Only when CONFORMANCE_PKG is a URL: download, check the recorded
44+
# sha256, and re-point CONFORMANCE_PKG at the verified local tarball.
45+
# When CONFORMANCE_PKG is a registry spec, this step is a no-op (npm's
46+
# own integrity check applies).
47+
run: |
48+
case "$CONFORMANCE_PKG" in
49+
https://*)
50+
curl -fsSL "$CONFORMANCE_PKG" -o /tmp/conformance.tgz
51+
echo "$CONFORMANCE_PKG_SHA256 /tmp/conformance.tgz" | sha256sum -c -
52+
echo "CONFORMANCE_PKG=file:/tmp/conformance.tgz" >> "$GITHUB_ENV"
53+
;;
54+
esac
4255
- run: uv sync --frozen --all-extras --package mcp-everything-server
4356
- name: Run server conformance (active suite)
4457
run: >-
@@ -70,6 +83,15 @@ jobs:
7083
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
7184
with:
7285
node-version: 24
86+
- name: Fetch and verify conformance harness
87+
run: |
88+
case "$CONFORMANCE_PKG" in
89+
https://*)
90+
curl -fsSL "$CONFORMANCE_PKG" -o /tmp/conformance.tgz
91+
echo "$CONFORMANCE_PKG_SHA256 /tmp/conformance.tgz" | sha256sum -c -
92+
echo "CONFORMANCE_PKG=file:/tmp/conformance.tgz" >> "$GITHUB_ENV"
93+
;;
94+
esac
7395
- run: uv sync --frozen --all-extras --package mcp
7496
- name: Run client conformance (all suite)
7597
run: >-

0 commit comments

Comments
 (0)