File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed
Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,28 @@ function clone
5050 git checkout " $SHA_TO_TEST "
5151 echo " Checked out nominal SHA $SHA_TO_TEST for PR $PR_TO_TEST "
5252 fi
53- git diff --name-only master HEAD | tee ci-changed-files.txt
53+ # Use BASE_BRANCH from environment variable if available, otherwise fall back to master
54+ if [ -n " $BASE_BRANCH " ]; then
55+ echo " Using base branch from environment: $BASE_BRANCH "
56+ # Fetch the specific base branch first (without depth limit to allow merge-base)
57+ git fetch origin " $BASE_BRANCH " || {
58+ echo " ERROR: Could not fetch base branch: $BASE_BRANCH "
59+ echo " Available remote branches:"
60+ git branch -r
61+ exit 1
62+ }
63+ MERGE_BASE=$( git merge-base HEAD " origin/$BASE_BRANCH " 2> /dev/null || echo " " )
64+ if [ -z " $MERGE_BASE " ]; then
65+ echo " ERROR: No merge base found with base branch: $BASE_BRANCH "
66+ echo " Available remote branches:"
67+ git branch -r
68+ exit 1
69+ fi
70+ git diff --name-only " $MERGE_BASE " HEAD | tee ci-changed-files.txt
71+ else
72+ echo " No BASE_BRANCH environment variable, using master"
73+ git diff --name-only master HEAD | tee ci-changed-files.txt
74+ fi
5475 else
5576 if [ -v SHA_TO_TEST ]; then
5677 git fetch --depth 2 origin " $SHA_TO_TEST "
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ def get_run_command(
3434 f"-e SHA_TO_TEST={ pr_info .sha } " ,
3535 f"-e BINARY_URL_TO_DOWNLOAD='{ build_url } '" ,
3636 f"-e FUZZER_TO_RUN='{ fuzzer_name } '" ,
37+ f"-e BASE_BRANCH='{ pr_info .base_ref } '" ,
3738 ]
3839
3940 env_str = " " .join (envs )
You can’t perform that action at this time.
0 commit comments