@@ -3999,7 +3999,7 @@ async function execCommand(command, args, options = {}, logError = true) {
39993999 return false ;
40004000 }
40014001}
4002- async function runAction ( opticToken , githubToken , additionalArgs , standardsFail , eventName , headRef , baseRef , owner , repo , sha ) {
4002+ async function runAction ( opticToken , githubToken , additionalArgs , standardsFail , eventName , headRef , baseRef , owner , repo , sha , refName ) {
40034003 const failOnCheckError = standardsFail === "true" ;
40044004 const valid = verifyInput ( opticToken , eventName , owner , repo ) ;
40054005 if ( ! valid ) {
@@ -4038,7 +4038,8 @@ async function runAction(opticToken, githubToken, additionalArgs, standardsFail,
40384038 core . error ( "Unable to determine base for comparison." ) ;
40394039 return 1 ;
40404040 }
4041- const comparisonRun = await diffAll ( opticToken , from , additionalArgs ) ;
4041+ const headTag = refName ? `gitbranch:${ refName } ` : undefined ;
4042+ const comparisonRun = await diffAll ( opticToken , from , additionalArgs , headTag ) ;
40424043 if ( eventName === "pull_request" ) {
40434044 const commentResult = await prComment ( githubToken , owner || "" , repo || "" , pr || "" , sha || "" ) ;
40444045 if ( ! commentResult ) {
@@ -4096,14 +4097,15 @@ async function deepen() {
40964097 }
40974098 return true ;
40984099}
4099- async function diffAll ( token , from , additionalArgs ) {
4100+ async function diffAll ( token , from , additionalArgs , headTag ) {
41004101 core . info ( "Running Optic diff-all" ) ;
41014102 return execCommand ( "optic" , [
41024103 "diff-all" ,
41034104 "--compare-from" ,
41044105 from ,
41054106 "--check" ,
41064107 "--upload" ,
4108+ ...( headTag ? [ "--head-tag" , headTag ] : [ ] ) ,
41074109 ...( additionalArgs ? [ additionalArgs ] : [ ] ) ,
41084110 ] , {
41094111 env : Object . assign ( Object . assign ( { } , process . env ) , { OPTIC_TOKEN : token } ) ,
@@ -4171,10 +4173,11 @@ const additionalArgs = core.getInput("additional_args");
41714173const eventName = process . env . GITHUB_EVENT_NAME ;
41724174const headRef = process . env . GITHUB_REF ;
41734175const baseRef = process . env . GITHUB_BASE_REF ;
4176+ const refName = process . env . GITHUB_REF_NAME ;
41744177const owner = process . env . GITHUB_REPOSITORY_OWNER ;
41754178const repo = ( _a = process . env . GITHUB_REPOSITORY ) === null || _a === void 0 ? void 0 : _a . split ( "/" ) [ 1 ] ;
41764179const sha = process . env . GITHUB_SHA ;
4177- ( 0 , action_1 . runAction ) ( opticToken , githubToken , additionalArgs , standardsFail , eventName , headRef , baseRef , owner , repo , sha )
4180+ ( 0 , action_1 . runAction ) ( opticToken , githubToken , additionalArgs , standardsFail , eventName , headRef , baseRef , owner , repo , sha , refName )
41784181 . then ( ( exitCode ) => {
41794182 return process . exit ( exitCode ) ;
41804183} )
0 commit comments