Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions .github/workflows/contract-drift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,26 @@ jobs:
run: pip install -e .[dev]

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

- name: Compare version and diff
id: diff
Expand Down
Loading