Conversation
There was a problem hiding this comment.
Pull request overview
This PR strengthens the container image supply-chain story by adding provenance + SBOM attestations via both buildx (registry-attached) and GitHub’s attestation store, and by publishing a GitHub Release on v* tags that attaches the generated artifacts and includes verification instructions.
Changes:
- Add
scripts/verify-image.shto verify both GitHub-native attestations (provenance + SBOM) against a digest-pinned image. - Add
scripts/release-body.shto generate a GitHub Release body from per-arch build metadata. - Extend
.github/workflows/publish.ymlto generate SBOM files, publish GitHub attestations, upload per-arch artifacts, and create/update a GitHub Release on tag pushes.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
scripts/verify-image.sh |
New consumer-facing verifier wrapper around gh attestation verify for provenance + SBOM. |
scripts/release-body.sh |
New release body generator that aggregates per-arch metadata into Markdown instructions. |
README.md |
Documents the new scripts/verify-image.sh helper. |
.github/workflows/publish.yml |
Adds provenance/SBOM generation + GitHub attestations, uploads artifacts, and creates a GitHub Release on v* tags. |
Comments suppressed due to low confidence (1)
scripts/release-body.sh:60
- The usage text says
--stellar-cli-version"must match the cli in every metadata file", but the aggregation jq currently filters out mismatching files (select(.stellar_cli_version == $cli)) and then succeeds as long as at least one matches. Consider failing if anymeta-*.jsonunder the directory has a differentstellar_cli_version(or if any are missing that field), so the release body can’t silently omit artifacts.
# Aggregate all meta-*.json files under the metadata dir into one JSON array.
local rows
rows="$(find "$metadata_dir" -type f -name 'meta-*.json' -print0 \
| xargs -0 jq -s --arg cli "$cli" \
'map(select(.stellar_cli_version == $cli))
| sort_by(.rust_version, .arch)')"
test "$(jq 'length' <<<"$rows")" -gt 0 \
|| die "no metadata files for stellar-cli $cli under $metadata_dir"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
What
Every published per-arch image is now signed under two independent attestation chains, and each
v*release gets a GitHub Release with the supply-chain artifacts attached.provenance: mode=max+sbom: trueondocker/build-push-action. SLSA build provenance and SPDX SBOM travel with the image in the registry, verifiable viacosign verify-attestation/docker buildx imagetools inspect.actions/attest-build-provenanceandactions/attest-sbompublish to the repo's attestation store (verifiable viagh attestation verify --repo stellar/stellar-cli-docker). Backing OIDC identity is the same; the verification UX is different.v*tag push (skipped onworkflow_dispatch), a newreleasejob downloads every per-arch artifact, composes a body listing the per-arch digests + verification commands, and attaches the SBOM and provenance files viasoftprops/action-gh-release.scripts/verify-image.sh— consumer-facing wrapper that runsgh attestation verifyfor both predicate types against a digest-pinned image. Refuses tag-only refs.scripts/release-body.sh— composes the release body markdown from the per-arch metadata files the build job uploads. Smoke-tested locally against synthetic metadata.Why
SEP-58 explicitly recommends CI provenance and an SBOM for trustworthy build images. The previous publish flow shipped the image with no supply-chain claim attached. After this PR, a verifier can:
and get back a passing-or-failing report on both attestations — or follow either chain manually via
cosign/docker buildx imagetools inspect/gh attestation verify.Notable choices
gh,cosign, anddocker buildxconsumers all have a native path. Workflow cost is small (anchore/sbom-action + twoattest-*steps per per-arch build).anchore/sbom-actionto generate the SBOM file rather than extracting from the buildx-attached SBOM. The file is needed both foractions/attest-sbom(which takes asbom-pathinput) and for the release attachment. Single source.if: startsWith(github.ref, 'refs/tags/v')).workflow_dispatchruns build + manifest + aliases but skips the release page — a manual dispatch has no GH tag context.releaseis incomplete'sneeds:but a skipped job result ('skipped') doesn't trigger the failure check, so dispatch-mode runs still complete cleanly.contents: write(release creation) +attestations: write(attest-* actions) +id-token: write(OIDC for both buildx provenance and the attest actions).uses:SHA-pinned to current latest releases:actions/attest-build-provenance@v4.1.0,actions/attest-sbom@v4.1.0,anchore/sbom-action@v0.24.0,actions/upload-artifact@v7.0.1,actions/download-artifact@v8.0.1,softprops/action-gh-release@v3.0.0.Depends on
#3 (
publish) — this branch is based on it. Base will auto-update tomainonce #3 merges.Verification
./scripts/release-body.shrenders a clean markdown body against synthetic metadata (4 rows: 2 rust versions × 2 archs)../scripts/verify-image.sh --helpworks; refuses tag-only refs (--image .../stellar-cli:latest→ exit 1 with clear message).shellcheckclean on both new scripts.v*tag once this PR merges — the release page should appear with.spdx.jsonand.intoto.jsonlattachments, andgh attestation verifyagainst any per-arch digest should pass for both predicate types.