@@ -6,23 +6,24 @@ const path = require('node:path')
6
6
7
7
async function main ( ) {
8
8
const [
9
- commitSha ,
9
+ githubSha ,
10
+ githubWorkflowSha ,
10
11
tarballDirectory = path . join ( os . tmpdir ( ) , 'vercel-nextjs-preview-tarballs' ) ,
11
12
] = process . argv . slice ( 2 )
12
13
const repoRoot = path . resolve ( __dirname , '..' )
13
14
14
15
await fs . mkdir ( tarballDirectory , { recursive : true } )
15
16
16
17
const [ { stdout : shortSha } , { stdout : dateString } ] = await Promise . all ( [
17
- execa ( 'git' , [ 'rev-parse' , '--short' , commitSha ] ) ,
18
+ execa ( 'git' , [ 'rev-parse' , '--short' , githubSha ] ) ,
18
19
// Source: https://github.com/facebook/react/blob/767f52237cf7892ad07726f21e3e8bacfc8af839/scripts/release/utils.js#L114
19
20
execa ( `git` , [
20
21
'show' ,
21
22
'-s' ,
22
23
'--no-show-signature' ,
23
24
'--format=%cd' ,
24
25
'--date=format:%Y%m%d' ,
25
- commitSha ,
26
+ githubSha ,
26
27
] ) ,
27
28
] )
28
29
@@ -97,16 +98,18 @@ async function main() {
97
98
] )
98
99
const packages = JSON . parse ( lernaListJson . stdout )
99
100
const packagesByVersion = new Map ( )
101
+ // vercel-packages finds GH artifacts via the head SHA because that's the only
102
+ // API GitHub offers.
100
103
for ( const packageInfo of packages ) {
101
104
packagesByVersion . set (
102
105
packageInfo . name ,
103
- `https://vercel-packages.vercel.app/next/commits/${ commitSha } /${ packageInfo . name } `
106
+ `https://vercel-packages.vercel.app/next/commits/${ githubWorkflowSha } /${ packageInfo . name } `
104
107
)
105
108
}
106
109
for ( const nextSwcPackageName of nextSwcPackageNames ) {
107
110
packagesByVersion . set (
108
111
nextSwcPackageName ,
109
- `https://vercel-packages.vercel.app/next/commits/${ commitSha } /${ nextSwcPackageName } `
112
+ `https://vercel-packages.vercel.app/next/commits/${ githubWorkflowSha } /${ nextSwcPackageName } `
110
113
)
111
114
}
112
115
0 commit comments