File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ const ciStats = require('./ci_stats');
2424 branch : process . env . GIT_BRANCH . replace ( / ^ ( r e f s \/ h e a d s \/ | o r i g i n \/ ) / , '' ) ,
2525 commit : process . env . GIT_COMMIT ,
2626 targetBranch : process . env . GITHUB_PR_TARGET_BRANCH || null ,
27- mergeBase : null , // TODO
27+ mergeBase : process . env . GITHUB_PR_MERGE_BASE || null ,
2828 } ) ;
2929 } catch ( ex ) {
3030 console . error ( ex ) ;
Original file line number Diff line number Diff line change @@ -40,6 +40,8 @@ if is_pr; then
4040 tc_set_env ghprbGhRepository " elastic/kibana" # TODO?
4141 tc_set_env ghprbActualCommit " $GITHUB_PR_TRIGGERED_SHA "
4242 tc_set_env BUILD_URL " $TEAMCITY_BUILD_URL "
43+
44+ set_git_merge_base
4345else
4446 tc_set_env ELASTIC_APM_ACTIVE " ${CI_REPORTING_ENABLED-} "
4547 tc_set_env CHECKS_REPORTER_ACTIVE false
Original file line number Diff line number Diff line change @@ -79,3 +79,10 @@ tc_retry() {
7979 }
8080 tc_end_block " Retryable Step - Attempt #1"
8181}
82+
83+ set_git_merge_base () {
84+ if [[ " ${GITHUB_PR_TARGET_BRANCH-} " ]]; then
85+ git fetch origin " $GITHUB_PR_TARGET_BRANCH "
86+ tc_set_env GITHUB_PR_MERGE_BASE " $( git merge-base HEAD FETCH_HEAD) "
87+ fi
88+ }
You can’t perform that action at this time.
0 commit comments