Skip to content

Commit

Permalink
Add Actionpath and Job to Entrypoint
Browse files Browse the repository at this point in the history
Closes: #226
Signed-off-by: Jeroen Knoops <jeroen.knoops@philips.com>
  • Loading branch information
JeroenKnoops committed Dec 2, 2022
1 parent 3df408f commit 25097a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/github/provenance.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (e *Environment) GenerateProvenanceStatement(ctx context.Context, subjecter
// See https://github.com/github/feedback/discussions/4188
intoto.WithInvocation(
BuildType,
e.Context.Workflow,
fmt.Sprintf("%s:%s", e.Context.ActionPath, e.Context.Job),
nil,
event.Inputs,
[]intoto.Item{
Expand Down
6 changes: 5 additions & 1 deletion pkg/github/provenance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ func TestGenerateProvenance(t *testing.T) {
Repository: "philips-labs/slsa-provenance-action",
Event: []byte(pushGitHubEvent),
EventName: "push",
ActionPath: ".github/workflows/build.yml",
Job: "job-context",
SHA: "849fb987efc0c0fc72e26a38f63f0c00225132be",
}
materials := []intoto.Item{
Expand Down Expand Up @@ -299,6 +301,8 @@ func TestGenerateProvenanceFromGitHubRelease(t *testing.T) {
Repository: "philips-labs/slsa-provenance-action",
Event: []byte(pushGitHubEvent),
EventName: "push",
ActionPath: ".github/workflows/build.yml",
Job: "job-context",
SHA: "849fb987efc0c0fc72e26a38f63f0c00225132be",
}
materials := []intoto.Item{
Expand Down Expand Up @@ -402,7 +406,7 @@ func TestGenerateProvenanceFromGitHubReleaseErrors(t *testing.T) {
}

func assertInvocation(assert *assert.Assertions, recipe intoto.Invocation) {
assert.Equal("", recipe.ConfigSource.EntryPoint)
assert.Equal(".github/workflows/build.yml:job-context", recipe.ConfigSource.EntryPoint)
assert.Nil(recipe.Environment)
assert.Nil(recipe.Parameters)
}
Expand Down

0 comments on commit 25097a8

Please sign in to comment.