File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -270,6 +270,19 @@ function getPullRequestBranches(): PullRequestBranches | undefined {
270270 head : pullRequest . head . label ,
271271 } ;
272272 }
273+
274+ // PR analysis under Default Setup does not have the pull_request context,
275+ // but it should set CODE_SCANNING_REF and CODE_SCANNING_BASE_BRANCH.
276+ const codeScanningRef = process . env . CODE_SCANNING_REF ;
277+ const codeScanningBaseBranch = process . env . CODE_SCANNING_BASE_BRANCH ;
278+ if ( codeScanningRef && codeScanningBaseBranch ) {
279+ return {
280+ base : codeScanningBaseBranch ,
281+ // PR analysis under Default Setup analyzes the PR head commit instead of
282+ // the merge commit, so we can use the provided ref directly.
283+ head : codeScanningRef ,
284+ } ;
285+ }
273286 return undefined ;
274287}
275288
You can’t perform that action at this time.
0 commit comments