Skip to content

Conversation

@crazy-max crazy-max changed the title docker-container: mount github event payload for provenance docker-container: copy github event payload to container for provenance Oct 6, 2025
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":
Copy link
Member

@tonistiigi tonistiigi Oct 22, 2025

Choose a reason for hiding this comment

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

Something more descriptive like "provenance-add-github-event" (provenance-add-github-actions-context)


func githubActionsEvent() ([]byte, error) {
m := make(map[string]any)
if v := os.Getenv("GITHUB_EVENT_NAME"); v != "" {
Copy link
Member

Choose a reason for hiding this comment

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

I think we should only add the event scope if all the envs we expect to be present are actually present.

if d.Files == nil {
d.Files = make(map[string][]byte)
}
d.Files["provenance.d/github_event.json"] = ghaedt
Copy link
Member

Choose a reason for hiding this comment

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

github_actions_context.json

@crazy-max crazy-max changed the title docker-container: copy github event payload to container for provenance docker-container: write github actions payload to container for provenance Oct 22, 2025
@crazy-max crazy-max force-pushed the mount-github-event branch 2 times, most recently from d982514 to 02d4768 Compare October 22, 2025 21:00
@crazy-max crazy-max requested a review from tonistiigi October 22, 2025 21:20
@crazy-max crazy-max force-pushed the mount-github-event branch 3 times, most recently from aca6cd9 to 073002a Compare October 23, 2025 09:27
Copy link
Member

@tonistiigi tonistiigi left a comment

Choose a reason for hiding this comment

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

Suggestion to move code, otherwise ok

}
}

func githubActionsContext() ([]byte, error) {
Copy link
Member

Choose a reason for hiding this comment

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

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Moved to util/ghutil and added some tests.

@tonistiigi tonistiigi merged commit 485e46b into docker:master Oct 24, 2025
138 checks passed
@crazy-max crazy-max deleted the mount-github-event branch October 24, 2025 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants