docker-container: write github actions payload to container for provenance#3453
Merged
tonistiigi merged 1 commit intodocker:masterfrom Oct 24, 2025
Merged
Conversation
crazy-max
commented
Oct 6, 2025
73ed9c5 to
02d8edf
Compare
3 tasks
tonistiigi
reviewed
Oct 22, 2025
driver/docker-container/factory.go
Outdated
| return nil, errors.Errorf("invalid env option %q, expecting env.FOO=bar", k) | ||
| } | ||
| d.env = append(d.env, fmt.Sprintf("%s=%s", envName, v)) | ||
| case k == "no-gha-event": |
Member
There was a problem hiding this comment.
Something more descriptive like "provenance-add-github-event" (provenance-add-github-actions-context)
driver/docker-container/driver.go
Outdated
|
|
||
| func githubActionsEvent() ([]byte, error) { | ||
| m := make(map[string]any) | ||
| if v := os.Getenv("GITHUB_EVENT_NAME"); v != "" { |
Member
There was a problem hiding this comment.
I think we should only add the event scope if all the envs we expect to be present are actually present.
driver/docker-container/driver.go
Outdated
| if d.Files == nil { | ||
| d.Files = make(map[string][]byte) | ||
| } | ||
| d.Files["provenance.d/github_event.json"] = ghaedt |
02d8edf to
f092192
Compare
d982514 to
02d4768
Compare
aca6cd9 to
073002a
Compare
tonistiigi
approved these changes
Oct 23, 2025
Member
tonistiigi
left a comment
There was a problem hiding this comment.
Suggestion to move code, otherwise ok
driver/docker-container/driver.go
Outdated
| } | ||
| } | ||
|
|
||
| func githubActionsContext() ([]byte, error) { |
Member
There was a problem hiding this comment.
Even though this is only used by container driver atm. I think it is better placed in generic pkg as not really driver specific in any way.
Member
Author
There was a problem hiding this comment.
Moved to util/ghutil and added some tests.
…nance Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
073002a to
7652057
Compare
tonistiigi
approved these changes
Oct 24, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
alternative to and closes #3452
follow-up moby/buildkit#6210
needs docs follow-up at https://docs.docker.com/build/builders/drivers/docker-container/#synopsis
example: https://oci.dag.dev/?blob=public.ecr.aws/q3b5f1u4/test-docker-action@sha256:176f66ab52141487a3e5b06058f391d3e44c1f86511ec54a692eccd10989853d&mt=application%2Fvnd.in-toto%2Bjson&size=17247