@@ -31,11 +31,12 @@ export default (ctx: Context): Git => {
3131 let gitInfo = JSON . parse ( fs . readFileSync ( ctx . env . SMARTUI_GIT_INFO_FILEPATH , 'utf-8' ) ) ;
3232
3333 return {
34- branch : gitInfo . branch || '' ,
34+ branch : ctx . env . CURRENT_BRANCH || gitInfo . branch || '' ,
3535 commitId : gitInfo . commit_id . slice ( 0 , 6 ) || '' ,
3636 commitMessage : gitInfo . commit_body || '' ,
3737 commitAuthor : gitInfo . commit_author || '' ,
38- githubURL : ( ctx . env . GITHUB_ACTIONS ) ? `${ constants . GITHUB_API_HOST } /repos/${ process . env . GITHUB_REPOSITORY } /statuses/${ gitInfo . commit_id } ` : ''
38+ githubURL : ( ctx . env . GITHUB_ACTIONS ) ? `${ constants . GITHUB_API_HOST } /repos/${ process . env . GITHUB_REPOSITORY } /statuses/${ gitInfo . commit_id } ` : '' ,
39+ baselineBranch : ctx . env . BASELINE_BRANCH || ''
3940 }
4041 } else {
4142 const splitCharacter = '<##>' ;
@@ -48,15 +49,16 @@ export default (ctx: Context): Git => {
4849
4950 // e.g. master\n or master\nv1.1\n or master\nv1.1\nv1.2\n
5051 var branchAndTags = res [ res . length - 1 ] . split ( '\n' ) . filter ( n => n ) ;
51- var branch = branchAndTags [ 0 ] ;
52+ var branch = ctx . env . CURRENT_BRANCH || branchAndTags [ 0 ] ;
5253 var tags = branchAndTags . slice ( 1 ) ;
5354
5455 return {
5556 branch : branch || '' ,
5657 commitId : res [ 0 ] || '' ,
5758 commitMessage : res [ 2 ] || '' ,
5859 commitAuthor : res [ 7 ] || '' ,
59- githubURL : ( ctx . env . GITHUB_ACTIONS ) ? `${ constants . GITHUB_API_HOST } /repos/${ process . env . GITHUB_REPOSITORY } /statuses/${ res [ 1 ] } ` : ''
60+ githubURL : ( ctx . env . GITHUB_ACTIONS ) ? `${ constants . GITHUB_API_HOST } /repos/${ process . env . GITHUB_REPOSITORY } /statuses/${ res [ 1 ] } ` : '' ,
61+ baselineBranch : ctx . env . BASELINE_BRANCH || ''
6062 } ;
6163 }
6264}
0 commit comments