Skip to content

Commit 1db26da

Browse files
pbertschclaude
andcommitted
ci: read the platform contract from the dispatch payload (raw download of the private repo 404s)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018tpBsXGDfaicezLgmDaWkv
1 parent 2e9ed05 commit 1db26da

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

‎.github/workflows/contract-drift.yml‎

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,26 @@ jobs:
2525
run: pip install -e .[dev]
2626

2727
- name: Fetch latest platform contract
28+
# The platform repo is private, so the contract cannot be downloaded
29+
# from raw.githubusercontent.com (that always returned 404 and the job
30+
# failed before it could report drift). The platform's dispatch now
31+
# carries it: gzip + base64 in client_payload.contractGzB64, with its
32+
# SHA-256. It is read only through env: and parsed as JSON, never
33+
# interpolated into the script. A scheduled run has no payload and
34+
# checks the vendored copy only.
35+
env:
36+
CONTRACT_GZ_B64: ${{ github.event.client_payload.contractGzB64 }}
37+
CONTRACT_SHA256: ${{ github.event.client_payload.contractSha256 }}
2838
run: |
29-
curl -sSL -o /tmp/latest-contract.json \
30-
https://raw.githubusercontent.com/AlphaWaveSystems/awsys-shortener/master/contracts/sdk-contract.json
39+
set -euo pipefail
40+
if [ -z "${CONTRACT_GZ_B64:-}" ]; then
41+
echo "::notice::No contract in the dispatch payload (scheduled run or an older sender); checking the vendored contract only."
42+
cp tests/contracts/sdk-contract.json /tmp/latest-contract.json
43+
else
44+
printf '%s' "$CONTRACT_GZ_B64" | base64 -d | gunzip > /tmp/latest-contract.json
45+
echo "${CONTRACT_SHA256} /tmp/latest-contract.json" | sha256sum -c -
46+
fi
47+
jq -e '.version | type == "string"' /tmp/latest-contract.json > /dev/null
3148
3249
- name: Compare version and diff
3350
id: diff

0 commit comments

Comments
 (0)