Repository navigation
ci: gate releases on an approved environment and sign, attest and SBOM release images - #1985
arnaubennassar wants to merge 12 commits into
Conversation
Verify that a release tag points at a commit reachable from develop or a release/* branch, and expose the version without the leading v. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Branch builds from the build-push workflow now go to ghcr.io/<owner>/<repo>-dev instead of the production package, so every tag and manifest list from this workflow lands in the development package. Production images are published by the release workflow only. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Checks the tag ruleset, release environment, branch rules, teams and GHCR package settings through read-only GitHub API calls. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Split the release workflow into preflight, approve, build and publish jobs: - preflight checks that the ref is a release tag whose commit is on develop or a release/* branch, and that the version is not already published - approve waits on the protected release environment before anything is pushed to the registry - build publishes only exact version tags (no moving X.Y or latest tags) and adds an SBOM and mode=max provenance to every image - publish creates the manifest lists, signs them with cosign keyless and pushes a GitHub build-provenance attestation for each The production manifest list now contains only the production platform images; previously it also picked up the -dev images. Runs for the same tag no longer cancel each other. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Document the published image tags, how to verify signatures and build provenance, and the repository settings that protect releases. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Claude finished @arnaubennassar's task in 1m 25s —— View job Review of #1985: release gating, signing and attestationThe overall design is sound. The I read the diff and the scripts but did not run anything, so none of the findings below were run. I could not check that the new action SHAs match their tags ( 🔴 Required
🟡 Suggested
🟢 Optional
Template summary🚀 What's NewRelease publishing is now gated: 🐛 Bug FixesThe production manifest list no longer includes 📋 Config UpdatesNone. No aggkit configuration changes. Admins must configure the GitHub settings listed in the runbook (teams,
|
…ase tags Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…tors Check the release environment for administrator bypass, all release/* branches (paginated) and bypass actors on the branch rulesets. State that only rulesets are read and that organization admins may bypass the tag ruleset (audited). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ements Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…nto ci/release-gating-attestation
|
Thanks for the review. I checked the action SHAs against upstream ( Required
Suggested Optional
|
The preflight job pinned actions/checkout to v5.1.0 while the build job uses v7.0.1. Pin preflight to the same commit so both jobs run the same checkout action. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
🔄 Changes Summary
Addresses the release-path finding in agglayer/issues#112: today any
v*.*.*tag push publishes production images toghcr.io/agglayer/aggkitwith no review, a movingX.Ytag that a later tag silently overwrites, and no signature, SBOM or verifiable provenance. After this change no single account can publish a production image.release.ymlis nowpreflight->approve->build->publish.preflight(read-only) runs the newscripts/release/check_tag_ancestry.sh. The ref must bevX.Y.ZorvX.Y.Z-<pre>, and the tagged commit must be an ancestor oforigin/developor anorigin/release/*branch. It also refuses to continue if the version is already published, so versions are immutable.approveuses thereleaseenvironment (required reviewers, prevent self-review). Nothing is pushed to the registry before a reviewer approves, becausebuildpushes by digest.buildproduces each platform image withsbom: trueandprovenance: mode=max.publishcreates the manifest lists, signs each with cosign (keyless) and adds a GitHub build-provenance attestation pushed to the registry. It is the only job withid-token: writeandattestations: write. Top-levelpermissions: {}, no job hascontents: write, and the new actions are pinned by commit SHA.ghcr.io/agglayer/aggkit-dev(build-push-docker-image.yml). Production images are only published byrelease.yml. Tag naming of branch builds is unchanged. No workflow in the repo consumes the oldghcr.io/agglayer/aggkit:<branch>_...tags.X.Y.Z[-pre],X.Y.Z[-pre]-no_shellandX.Y.Z[-pre]-dev. The movingX.Y,X.Y-no_shellandX.Y-devtags are no longer published, and there is nolatest. Branch and PR tag types are removed from the release metadata. Deployments should pin an exact version or, better, a digest.-devplatform images, so the production manifest list could include dev images.publishnow selects only the platform images of its own variant.scripts/release/check_release_settings.sh: a read-only (GET only) audit of the GitHub controls the release path relies on (tag ruleset,releaseenvironment, branch protection, teams, package ACL). It printsPASS/FAIL/MANUALper control and exits non-zero on anyFAIL(--jsonis supported).docs/release_verification.md(operators:cosign verify,gh attestation verify, SBOM inspection, pin by digest) anddocs/release_admin_runbook.md(admins), linked fromdocs/SUMMARY.mdanddocs/release_lifecycle.md. Images published before this change are unsigned.X.Y,X.Y-no_shellandX.Y-devimage tags are no longer published. Consumers following them must pin an exactX.Y.Zversion or a digest.📋 Config Updates
✅ Testing
bash scripts/release/check_tag_ancestry_test.shcovers a commit on develop, onrelease/0.11only, on an unrelated branch, a malformed tag and a non-tag ref.bash scripts/release/check_release_settings_test.shuses a stubghand covers all-pass, a missing tag ruleset, an environment without prevent-self-review, and the package ACL reported as manual.shellcheck scripts/release/*.shis clean.actionlinton both workflows: see the note below.approve, the author cannot approve, a tag on an unreviewed branch fails inpreflight,cosign verifysucceeds).actionlint note:
arm-runner-2204(andamd-runner-2204) are self-hosted runner labels that actionlint does not know by default. This is already the case ondevelop. With those labels declared in an actionlint config,release.ymlis clean. The remaining shellcheck info/style findings inbuild-push-docker-image.ymlare pre-existing and untouched by this PR.🐞 Issues
📝 Notes
Settings that must be applied by admins before the next release (step-by-step in
docs/release_admin_runbook.md; verify withscripts/release/check_release_settings.sh). Without them the gates in this PR are not enforced:release-approversandrelease-manager.release: required reviewersrelease-approvers, prevent self-review, deployment policy limited to tagsv*, no admin bypass.refs/tags/v*(creation, update, deletion and non-fast-forward restricted; bypass onlyrelease-manager; organization admins may also bypass, and the audit log records it).developandrelease/*require a PR with at least one approval, no direct pushes, force-pushes or deletion.aggkit: disable inherited repository access and grant Actions write only toagglayer/aggkit; configureaggkit-devafter its first build.Tag workflows run the workflow file from the tagged commit, so the ancestry check is only a guarantee together with items 3 and 4. Residual risks (colluding maintainers, other workflows with
packages: write) and an optional further hardening are in the runbook.