Merge pull request #1863 from meriadec/attest-provenance-tags

Handle tags containing "@" character in `buildSLSAProvenancePredicate`
This commit is contained in:
Brian DeHamer authored and GitHub committed 2024-11-01 09:35:13 -07:00
commit 51b0cb5578
3 files changed
+68 -10

No files matched your search

+3 -1
View File
@@ -30,9 +30,11 @@ export const buildSLSAProvenancePredicate = async (
// Split just the path and ref from the workflow string.
// owner/repo/.github/workflows/main.yml@main =>
// .github/workflows/main.yml, main
const [workflowPath, workflowRef] = claims.workflow_ref
const [workflowPath, ...workflowRefChunks] = claims.workflow_ref
.replace(`${claims.repository}/`, '')
.split('@')
// Handle case where tag contains `@` (e.g: when using changesets in a monorepo context),
const workflowRef = workflowRefChunks.join('@')
return {
type: SLSA_PREDICATE_V1_TYPE,