Skip to content

Conversation

caarlos0
Copy link
Member

closes #4852
refs actions/attest-build-provenance#454

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
@caarlos0 caarlos0 self-assigned this Aug 20, 2025
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 20, 2025
Copy link

cloudflare-workers-and-pages bot commented Aug 20, 2025

Deploying goreleaser with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9195b9f
Status: ✅  Deploy successful!
Preview URL: https://d5d67018.goreleaser.pages.dev
Branch Preview URL: https://docker-attest.goreleaser.pages.dev

View logs

@caarlos0 caarlos0 requested a review from Copilot August 20, 2025 04:22
@caarlos0 caarlos0 changed the title feat: create docker images digest file for attestation feat(docker): create images digest file for attestation Aug 20, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements functionality to create a Docker images digest file for build attestation. The feature addresses the need for generating digest information that can be consumed by GitHub's attestation action to verify image provenance.

  • Adds a new docker_digest configuration option to generate a digests.txt file containing image digests and names
  • Integrates the new digest pipe into the publishing pipeline to run after Docker images are pushed
  • Updates documentation and workflows to demonstrate usage with GitHub's attestation action

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
www/mkdocs.yml Adds navigation entry for new Docker digests documentation
www/docs/customization/docker_digests.md New documentation page explaining the docker_digest feature
www/docs/customization/attestations.md Updates attestation docs to include Docker image attestation workflow
pkg/defaults/defaults.go Registers the new dockerdigest pipe in the default pipeline
pkg/config/config.go Adds DockerDigest configuration struct and integrates it into Project config
internal/pipe/publish/publish.go Includes dockerdigest pipe in the publishing pipeline
internal/pipe/dockerdigest/digest_test.go Test suite for the new dockerdigest functionality
internal/pipe/dockerdigest/digest.go Core implementation of the dockerdigest pipe
internal/pipe/checksums/checksums.go Minor error message correction
.github/workflows/release.yml Adds attestation step for Docker digests
.github/workflows/nightly-oss.yml Adds attestation step for Docker digests

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Copy link

codecov bot commented Aug 20, 2025

Codecov Report

❌ Patch coverage is 92.68293% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.77%. Comparing base (466860b) to head (9195b9f).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
internal/pipe/dockerdigest/digest.go 92.50% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6001      +/-   ##
==========================================
+ Coverage   82.75%   82.77%   +0.01%     
==========================================
  Files         165      166       +1     
  Lines       16571    16607      +36     
==========================================
+ Hits        13714    13747      +33     
- Misses       2265     2267       +2     
- Partials      592      593       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
@caarlos0 caarlos0 merged commit 6a54103 into main Aug 21, 2025
18 checks passed
@caarlos0 caarlos0 deleted the docker-attest branch August 21, 2025 00:26
caarlos0 added a commit that referenced this pull request Aug 21, 2025
This is the v2 of the docker feature!

- better DX (less yaml repetition and templates)
- simpler implementation 

### So now, what happens:

- if `--snapshot`, it'll build the manifest, but not push it (only
useful to test the actual docker image build, not the image itself)
- otherwise, on publish, it'll run a single `docker buildx build` to
build and publish the manifest + SBOM
- `docker_signs` should still work
- `docker_digests` should still work

Discussion for after the merge:
https://github.com/orgs/goreleaser/discussions/6005

### TODO from the top of my head:

- [x] ~~pro: split/merge wiring~~[^1]
- [x] tests
- [x] signing
- [x] sbom
- [x] attestations #6001

---

closes #5733 

[^1]: Not really needed, will only run in publish, which runs in the
merging step.

---------

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
@Belphemur
Copy link
Contributor

@caarlos0 there is a typo either in the doc or the code:
Code expect: docker_digest
Doc says to use: docker_digests

The S at the end is the issue.

@caarlos0
Copy link
Member Author

typo on the docs - thanks @Belphemur will fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Github Artifact Attestations
2 participants