+11
@@ -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,
|
||||
|
||||
+19
-1
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user