How do you generate build provenance for a GitHub Actions release?
IntermediateScenarioSupply Chain Security
Answer
Situation read → Provenance records the repo, commit, workflow and builder identity, signed by the platform.
What I'd do →
- Add permissions
id-token: write,attestations: write,contents: read. - Use
actions/attest-build-provenancewith the artifact path or image digest:
- uses: actions/attest-build-provenance@<sha>
with:
subject-name: ghcr.io/example-org/app
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true
- Verify before deploy:
gh attestation verify oci://ghcr.io/example-org/app@sha256:... --owner example-org.
Why → Verification links an artifact to a specific repo and workflow.
Interview tip → Provenance proves origin, not that the code is free of bugs.
More on Supply Chain Security
What is an SBOM, and at which point in the pipeline do you generate it?BeginnerA customer asks for an SBOM for your product. What do you give them?BeginnerHow do you sign container images in GitHub Actions without managing private keys?IntermediateYou signed images in CI. How do you make sure the cluster only runs signed images?IntermediateLeadership wants "SLSA compliance". What do you propose?IntermediateWhat is typosquatting and how do you protect developers from it?Beginner