diff --git a/dist/index.js b/dist/index.js index 246019c..5ea28ec 100644 --- a/dist/index.js +++ b/dist/index.js @@ -147264,6 +147264,17 @@ const createAttestation = async (subjects, predicate, opts) => { const result = attestation; if (subjects.length === 1 && opts.pushToRegistry) { const subject = subjects[0]; + const record = await (0, attest_1.createStorageRecord)({ + artifactOptions: { + name: subject.name, + digest: (0, subject_1.formatSubjectDigest)(subject) + }, + packageRegistryOptions: { + registryUrl: 'https://ghcr.io' + }, + token: opts.githubToken, + writeOptions: {} + }); const credentials = (0, oci_1.getRegistryCredentials)(subject.name); const artifact = await (0, oci_1.attachArtifactToImage)({ credentials, diff --git a/src/attest.ts b/src/attest.ts index 3b59cdb..068da37 100644 --- a/src/attest.ts +++ b/src/attest.ts @@ -1,4 +1,10 @@ -import { Attestation, Predicate, Subject, attest } from '@actions/attest' +import { + Attestation, + Predicate, + Subject, + attest, + createStorageRecord +} from '@actions/attest' import { attachArtifactToImage, getRegistryCredentials } from '@sigstore/oci' import { formatSubjectDigest } from './subject' @@ -32,6 +38,18 @@ export const createAttestation = async ( if (subjects.length === 1 && opts.pushToRegistry) { const subject = subjects[0] + const record = await createStorageRecord({ + artifactOptions: { + name: subject.name, + digest: formatSubjectDigest(subject) + }, + packageRegistryOptions: { + registryUrl: 'https://ghcr.io' + }, + token: opts.githubToken, + writeOptions: {} + }) + const credentials = getRegistryCredentials(subject.name) const artifact = await attachArtifactToImage({ credentials,