fix(ci): fail release when build attestation fails - #216
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 567965dd2b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -99,7 +99,6 @@ jobs: | |||
|
|
|||
| - name: Attest | |||
| uses: actions/attest-build-provenance@v1 | |||
There was a problem hiding this comment.
Gate image tags before failing on attestation
When the attestation service or registry write fails, this now fails the job only after the Docker Build step has already run with push: true and the metadata includes the release/latest tags. That leaves GHCR tags advanced to an unattested digest while create-github-release is skipped via needs: docker-build, producing a partial release instead of preventing publication. Gate the final tags on a successful attestation, such as pushing a staging/digest-only reference first and tagging the release only after attestation succeeds, before making this step fatal.
Useful? React with 👍 / 👎.
Push a sha-only image first, attest it, then retag latest/version so a failed attestation cannot advance release tags to an unattested digest.
Motivation
continue-on-error.Description
continue-on-error: trueline from theAtteststep in.github/workflows/release.ymlso thedocker-buildjob fails when attestation fails.Testing
sed -n '1,220p' .github/workflows/release.yml), inspecting the diff (git diff -- .github/workflows/release.yml), checking the edited lines (nl -ba .github/workflows/release.yml | sed -n '88,112p'), and committing the change (git commit), and all commands completed successfully.Codex Task
Note
Medium Risk
Changes the release publish path for container images; a misconfigured promote step could leave tags stale or only partially updated, though runtime app code is unaffected.
Overview
The release workflow now blocks publishing
latestand version tags until build provenance attestation succeeds, and fails the job if attestation fails (thecontinue-on-errorbypass on the Attest step is removed).Instead of tagging the image as
latest/release version on the initial push, the first build only pushes a SHA reference. After attestation passes, a new step usesdocker buildx imagetools createto pointlatestand the release version tag at the already-built, attested digest—so a failed attestation never advances consumer-facing tags.Reviewed by Cursor Bugbot for commit c0e08f7. Bugbot is set up for automated code reviews on this repo. Configure here.