Skip to content

Commit c1fc897

Browse files
committed
getFileDiffsWithBasehead(): use CODE_SCANNING_REPOSITORY if present
1 parent f88459c commit c1fc897

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/analyze.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { EnvVar } from "./environment";
2222
import { FeatureEnablement, Feature } from "./feature-flags";
2323
import { isScannedLanguage, Language } from "./languages";
2424
import { Logger, withGroupAsync } from "./logging";
25-
import { getRepositoryNwo } from "./repository";
25+
import { getRepositoryNwoFromEnv } from "./repository";
2626
import { DatabaseCreationTimings, EventReport } from "./status-report";
2727
import { ToolsFeature } from "./tools-features";
2828
import { endTracingForCluster } from "./tracer-config";
@@ -390,7 +390,12 @@ async function getFileDiffsWithBasehead(
390390
branches: PullRequestBranches,
391391
logger: Logger,
392392
): Promise<FileDiff[] | undefined> {
393-
const repositoryNwo = getRepositoryNwo();
393+
// Check CODE_SCANNING_REPOSITORY first. If it is empty or not set, fall back
394+
// to GITHUB_REPOSITORY.
395+
const repositoryNwo = getRepositoryNwoFromEnv(
396+
"CODE_SCANNING_REPOSITORY",
397+
"GITHUB_REPOSITORY",
398+
);
394399
const basehead = `${branches.base}...${branches.head}`;
395400
try {
396401
const response = await getApiClient().rest.repos.compareCommitsWithBasehead(

0 commit comments

Comments
 (0)