-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: provenance build type v2 #6228
Conversation
Removes the following env vars from the generated package provenance: GITHUB_ACTOR_ID, GITHUB_REF_TYPE, and GITHUB_RUN_NUMBER. Signed-off-by: Brian DeHamer <bdehamer@github.com>
Updates the materials.uri value in the package provenance to include the @ref Signed-off-by: Brian DeHamer <bdehamer@github.com>
const [workflowPath] = (env.GITHUB_WORKFLOW_REF || '') | ||
.replace(env.GITHUB_REPOSITORY + '/', '') | ||
.split('@') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are there tests that explain why this change is needed?
7cc0fe6
to
daea47f
Compare
@feelepxyz thoughts on this last commit which updates the
|
What does a typical |
d938ea9
to
6139ae1
Compare
The raw
and we need to extract just the repo-relative workflow path from that:
|
Updates the entryPoint in the generated provenance to contain just the repo-relative path to the triggering workflow. Signed-off-by: Brian DeHamer <bdehamer@github.com>
Signed-off-by: Brian DeHamer <bdehamer@github.com>
6139ae1
to
128c542
Compare
With these changes, the new provenance statement will look something like: {
"_type": "https://in-toto.io/Statement/v0.1",
"subject": [
{
"name": "pkg:npm/sigstore@1.0.0",
"digest": {
"sha512": "7bea9f6e7ff37f5fab0b36bf061200fff03099fd2fd696b91d04bc5e4f225eb9fd6e0cadcad54ba980f43fb352a99e8810b4e0abeb5c0ef2cf9108cd1f258b36"
}
}
],
"predicateType": "https://slsa.dev/provenance/v0.2",
"predicate": {
"buildType": "https://github.com/npm/cli/gha/v2",
"builder": {
"id": "https://github.com/actions/runner"
},
"invocation": {
"configSource": {
"uri": "git+https://github.com/sigstore/sigstore-js@refs/tags/v1.0.0",
"digest": {
"sha1": "06528997c3c8ab9f864fad9a3658446aca7fd86d"
},
"entryPoint": ".github/workflows/publish.yml"
},
"parameters": {},
"environment": {
"GITHUB_EVENT_NAME": "release",
"GITHUB_REF": "refs/tags/v1.0.0",
"GITHUB_REPOSITORY": "sigstore/sigstore-js",
"GITHUB_REPOSITORY_ID": "495574555",
"GITHUB_REPOSITORY_OWNER_ID": "71096353",
"GITHUB_RUN_ATTEMPT": "1",
"GITHUB_RUN_ID": "4137028816",
"GITHUB_SHA": "06528997c3c8ab9f864fad9a3658446aca7fd86d",
"GITHUB_WORKFLOW_REF": "sigstore/sigstore-js/.github/workflows/publish.yml@refs/tags/v1.0.0",
"GITHUB_WORKFLOW_SHA": "06528997c3c8ab9f864fad9a3658446aca7fd86d"
}
},
"metadata": {
"buildInvocationId": "4137028816-1",
"completeness": {
"parameters": false,
"environment": false,
"materials": false
},
"reproducible": false
},
"materials": [
{
"uri": "git+https://github.com/sigstore/sigstore-js@refs/tags/v1.0.0",
"digest": {
"sha1": "06528997c3c8ab9f864fad9a3658446aca7fd86d"
}
}
]
}
} |
07b2a66
to
f0077aa
Compare
Signed-off-by: Brian DeHamer <bdehamer@github.com>
f0077aa
to
245e055
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor spec copy, otherwise LGTM 👍
Co-authored-by: Philip Harrison <philip@mailharrison.com>
Various updates to the generated provenance statement:
materials.uri
value to include theGITHUB_REF
valueentryPoint
value to include just the repo-relative path to the initiating workflow:github/foo/.github/workflows/publish.yml@refs/heads/main
→.github/workflows/publish.yml
builder.id
andbuildType
fields