File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ export const DENO_DEPLOYMENT_ID: string | undefined = Deno.env.get(
66const deploymentId = DENO_DEPLOYMENT_ID ||
77 // For CI
88 Deno . env . get ( "GITHUB_SHA" ) ||
9+ Deno . env . get ( "CI_COMMIT_SHA" ) ||
910 crypto . randomUUID ( ) ;
1011const buildIdHash = await crypto . subtle . digest (
1112 "SHA-1" ,
Original file line number Diff line number Diff line change @@ -39,18 +39,22 @@ export function setBuildId(id) {
3939}
4040
4141export async function getBuildId ( dev : boolean ) : Promise < string > {
42- // Check for GIT_REVISION environment variable first
43- const gitRevision = Deno . env . get ( "GIT_REVISION " ) ;
42+ const gitRevision = Deno . env . get ( "DENO_DEPLOYMENT_ID" ) ??
43+ Deno . env . get ( "GITHUB_SHA" ) ?? Deno . env . get ( "CI_COMMIT_SHA " ) ;
4444 if ( gitRevision !== undefined ) {
4545 return gitRevision ;
4646 }
4747
4848 if ( ! dev ) {
49- const bin = Deno . build . os === "windows" ? "git.exe" : "git" ;
50- const res = await new Deno . Command ( bin , { args : [ "rev-parse" , "HEAD" ] } )
51- . output ( ) ;
52-
53- return new TextDecoder ( ) . decode ( res . stdout ) ;
49+ try {
50+ const bin = Deno . build . os === "windows" ? "git.exe" : "git" ;
51+ const res = await new Deno . Command ( bin , { args : [ "rev-parse" , "HEAD" ] } )
52+ . output ( ) ;
53+
54+ return new TextDecoder ( ) . decode ( res . stdout ) ;
55+ } catch {
56+ // ignore
57+ }
5458 }
5559
5660 const arr = new Uint32Array ( 1 ) ;
You can’t perform that action at this time.
0 commit comments