reinstate main tests
This commit is contained in:
+18
-2
@@ -30,7 +30,7 @@ export async function uploadOCIImageManifest(
|
||||
|
||||
await Promise.all(layerUploads)
|
||||
|
||||
return await uploadManifest(
|
||||
const publishedDigest = await uploadManifest(
|
||||
JSON.stringify(manifest),
|
||||
manifest.mediaType,
|
||||
registry,
|
||||
@@ -38,6 +38,14 @@ export async function uploadOCIImageManifest(
|
||||
tag || manifestSHA,
|
||||
b64Token
|
||||
)
|
||||
|
||||
if (publishedDigest !== manifestSHA) {
|
||||
throw new Error(
|
||||
`Digest mismatch. Expected ${manifestSHA}, got ${publishedDigest}.`
|
||||
)
|
||||
}
|
||||
|
||||
return manifestSHA
|
||||
}
|
||||
|
||||
export async function uploadOCIIndexManifest(
|
||||
@@ -54,7 +62,7 @@ export async function uploadOCIIndexManifest(
|
||||
`Uploading index manifest ${manifestSHA} with tag ${tag} to ${repository}.`
|
||||
)
|
||||
|
||||
return await uploadManifest(
|
||||
const publishedDigest = await uploadManifest(
|
||||
JSON.stringify(manifest),
|
||||
manifest.mediaType,
|
||||
registry,
|
||||
@@ -62,6 +70,14 @@ export async function uploadOCIIndexManifest(
|
||||
tag,
|
||||
b64Token
|
||||
)
|
||||
|
||||
if (publishedDigest !== manifestSHA) {
|
||||
throw new Error(
|
||||
`Digest mismatch. Expected ${manifestSHA}, got ${publishedDigest}.`
|
||||
)
|
||||
}
|
||||
|
||||
return manifestSHA
|
||||
}
|
||||
|
||||
async function uploadLayer(
|
||||
|
||||
+14
-9
@@ -1,18 +1,23 @@
|
||||
import { FileMetadata } from './fs-helper'
|
||||
import * as crypto from 'crypto'
|
||||
|
||||
const imageIndexMediaType = 'application/vnd.oci.image.index.v1+json'
|
||||
const imageManifestMediaType = 'application/vnd.oci.image.manifest.v1+json'
|
||||
const actionsPackageMediaType = 'application/vnd.github.actions.package.v1+json'
|
||||
const actionsPackageTarLayerMediaType =
|
||||
export const imageIndexMediaType = 'application/vnd.oci.image.index.v1+json'
|
||||
export const imageManifestMediaType =
|
||||
'application/vnd.oci.image.manifest.v1+json'
|
||||
export const actionsPackageMediaType =
|
||||
'application/vnd.github.actions.package.v1+json'
|
||||
export const actionsPackageTarLayerMediaType =
|
||||
'application/vnd.github.actions.package.layer.v1.tar+gzip'
|
||||
const actionsPackageZipLayerMediaType =
|
||||
export const actionsPackageZipLayerMediaType =
|
||||
'application/vnd.github.actions.package.layer.v1.zip'
|
||||
const sigstoreBundleMediaType = 'application/vnd.dev.sigstore.bundle.v0.3+json'
|
||||
export const sigstoreBundleMediaType =
|
||||
'application/vnd.dev.sigstore.bundle.v0.3+json'
|
||||
|
||||
const actionPackageAnnotationValue = 'actions_oci_pkg'
|
||||
const actionPackageAttestationAnnotationValue = 'actions_oci_pkg_attestation'
|
||||
const actionPackageReferrerTagAnnotationValue = 'actions_oci_pkg_referrer_tag'
|
||||
export const actionPackageAnnotationValue = 'actions_oci_pkg'
|
||||
export const actionPackageAttestationAnnotationValue =
|
||||
'actions_oci_pkg_attestation'
|
||||
export const actionPackageReferrerTagAnnotationValue =
|
||||
'actions_oci_pkg_referrer_tag'
|
||||
|
||||
export const ociEmptyMediaType = 'application/vnd.oci.empty.v1+json'
|
||||
export const emptyConfigSize = 2
|
||||
|
||||
Reference in New Issue
Block a user