File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 1313 environment : production
1414 steps :
1515 - uses : actions/checkout@v2
16+ with :
17+ fetch-depth : 0
1618 - uses : actions/setup-node@v1
1719 with :
1820 node-version : 16
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ async function main() {
2525 // See https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables
2626 const repository = process . env [ "GITHUB_REPOSITORY" ] ;
2727 const runId = process . env [ "GITHUB_RUN_ID" ] ;
28+ const githubBaseUrl = process . env [ "GITHUB_SERVER_URL" ] ;
2829
2930 if ( repository == null ) {
3031 throw new Error ( "Missing environment variable GITHUB_REPOSITORY" ) ;
@@ -34,11 +35,15 @@ async function main() {
3435 throw new Error ( "Missing environment variable GITHUB_RUN_ID" ) ;
3536 }
3637
38+ if ( githubBaseUrl == null ) {
39+ throw new Error ( "Missing environment variable GITHUB_SERVER_URL" ) ;
40+ }
41+
3742 await writeFile (
3843 "build-info.json" ,
3944 JSON . stringify ( {
4045 gitSha : ( await runCommand ( "git rev-parse HEAD" ) ) . trim ( ) ,
41- buildUrl : `https://github.com /${ repository } /actions/runs/${ runId } ` ,
46+ buildUrl : `${ githubBaseUrl } /${ repository } /actions/runs/${ runId } ` ,
4247 } )
4348 ) ;
4449}
You can’t perform that action at this time.
0 commit comments