66 * This script downloads a pre-built Gutenberg zip artifact from the GitHub
77 * Container Registry and extracts it into the ./gutenberg directory.
88 *
9- * The artifact is identified by the "gutenberg.ref " value in the root
9+ * The artifact is identified by the "gutenberg.sha " value in the root
1010 * package.json, which is used as the OCI image tag for the gutenberg-build
1111 * package on GHCR.
1212 *
@@ -72,25 +72,25 @@ function exec( command, args, options = {} ) {
7272async function main ( ) {
7373 console . log ( '🔍 Checking Gutenberg configuration...' ) ;
7474
75- // Read Gutenberg ref from package.json.
76- let ref ;
75+ // Read Gutenberg SHA from package.json.
76+ let sha ;
7777 try {
7878 const packageJson = JSON . parse (
7979 fs . readFileSync ( packageJsonPath , 'utf8' )
8080 ) ;
81- ref = packageJson . gutenberg ?. ref ;
81+ sha = packageJson . gutenberg ?. sha ;
8282
83- if ( ! ref ) {
84- throw new Error ( 'Missing "gutenberg.ref " in package.json' ) ;
83+ if ( ! sha ) {
84+ throw new Error ( 'Missing "gutenberg.sha " in package.json' ) ;
8585 }
8686
87- console . log ( ` Reference : ${ ref } ` ) ;
87+ console . log ( ` SHA : ${ sha } ` ) ;
8888 } catch ( error ) {
8989 console . error ( '❌ Error reading package.json:' , error . message ) ;
9090 process . exit ( 1 ) ;
9191 }
9292
93- const zipName = `gutenberg-${ ref } .zip` ;
93+ const zipName = `gutenberg-${ sha } .zip` ;
9494 const zipPath = path . join ( rootDir , zipName ) ;
9595
9696 // Step 1: Get an anonymous GHCR token for pulling.
@@ -113,15 +113,15 @@ async function main() {
113113 }
114114
115115 // Step 2: Get the manifest to find the blob digest.
116- console . log ( `\n📋 Fetching manifest for ${ ref } ...` ) ;
116+ console . log ( `\n📋 Fetching manifest for ${ sha } ...` ) ;
117117 let digest ;
118118 try {
119119 const manifestJson = await exec ( 'curl' , [
120120 '--silent' ,
121121 '--fail' ,
122122 '--header' , `Authorization: Bearer ${ token } ` ,
123123 '--header' , 'Accept: application/vnd.oci.image.manifest.v1+json' ,
124- `https://ghcr.io/v2/${ GHCR_REPO } /manifests/${ ref } ` ,
124+ `https://ghcr.io/v2/${ GHCR_REPO } /manifests/${ sha } ` ,
125125 ] , { captureOutput : true } ) ;
126126 const manifest = JSON . parse ( manifestJson ) ;
127127 digest = manifest ?. layers ?. [ 0 ] ?. digest ;
0 commit comments