Skip to content

Attest release builds and pin examples to releases - #15

Merged
devGregA merged 5 commits into
mainfrom
release/attest-provenance
Nov 20, 2026
Merged

devGregA merged 5 commits into
mainfrom
release/attest-provenance

Conversation

@devGregA

Copy link
Copy Markdown
Contributor

Every release now carries a build provenance attestation for each file attached to the release and for the container image. Check one with gh attestation verify <file> --repo DefectDojo/earlylight. The README has the full command, including --signer-workflow and --source-ref, and the form for oci://ghcr.io/defectdojo/earlylight:<tag>.

Release workflow

  • Attests dist/* (binaries, checksums.txt and its signature bundle, licenses, detectors.json) and the image digest with actions/attest-build-provenance, pinned by SHA. The image attestation is pushed to GHCR.
  • id-token: write and attestations: write are granted to the release job only. The workflow itself has no permissions.
  • The image is pushed by digest and attested, and only then tagged :vX.Y.Z and :latest. The step checks that both tags name the attested digest.
  • Runs only for release tags (v1.2.3), so pushing a major tag such as v0 never creates a release.
  • The image is pushed and attested before the release is published. gh release create publishes only after every asset is uploaded.
  • The major tag (v0) stays a plain tag with no release and moves after each release.

Action

  • Pinned to a commit SHA or a major tag, the action installs the release at that commit. Before, a SHA pin installed the latest release.
  • If it cannot list the release tags for such a pin, the step fails instead of running another release.
  • CI tests the lookup against a fixed tag listing.

Docs

  • The README and install.sh name release tags instead of main. The action example is pinned to a release.
  • The README shows how to verify a release.

Admin step after merge (Settings → General → Releases)

  1. Turn on Enable release immutability. It applies to releases published from then on.
  2. Add no tag ruleset that matches the major tags (v0, v1): the release workflow moves them with each release. Scope any tag ruleset to v*.*.*.
  3. Never create a GitHub release for a major tag.

Checked on the first release: the workflow run, both attestations, the image tags, and gh attestation verify for a binary and for the image.

🤖 Generated with Claude Code

devGregA and others added 5 commits November 20, 2026 00:52
The release workflow now attaches a build provenance attestation
(actions/attest-build-provenance, pinned by SHA) to every file the
release attaches and to the container image, pushed with the image.
id-token and attestations write are granted to the release job only;
the workflow itself has no permissions.

The workflow runs only for release tags (v1.2.3), so pushing a major
tag such as v0 can never create a release for it. The image is pushed
and attested before the release is published, and gh publishes the
release only after every asset is uploaded, which immutable releases
require. The major tag stays a plain moving tag with no release.

The README and install.sh name release tags instead of main. The
README shows how to check a release with gh attestation verify.

The action, pinned to a major tag or a commit SHA, now installs the
release at that commit (scripts/action-release.sh over git ls-remote).
Before, a SHA pin installed the latest release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The image is pushed by digest, attested, and only then tagged
:vX.Y.Z and :latest with docker buildx imagetools create. A failed
attestation now leaves no tag naming an unattested image. The step
checks that both tags resolve to the attested digest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
uses: ./ runs with no action ref, so CI never exercised
scripts/action-release.sh. scripts/test-action-release.sh feeds it a
fixed tag listing (a major tag, an annotated tag's commit, a tag
object, a branch name, v0.10.0 over v0.9.0, a major tag with no
release of its own) under every awk on the runner.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
For a commit SHA or major-tag pin, a failed git ls-remote used to read
as no match and install the latest release with a warning. It now
fails the step (exit 2). The fallback to the latest release stays for
a listing that succeeded with no match, and for refs such as a branch
name that need no lookup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@devGregA
devGregA merged commit d494d73 into main Nov 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant