mirror of
https://github.com/github/codeql-action.git
synced 2026-01-05 06:00:32 +08:00
Overlay databases: use --overlay-changes
This commit changes overlay database creation to use the --overlay-changes flag. It also implements Git-based file change detection to generate the list of files to extract for the overlay database.
This commit is contained in:
@@ -24,7 +24,11 @@ import {
|
||||
import { isAnalyzingDefaultBranch } from "./git-utils";
|
||||
import { Language } from "./languages";
|
||||
import { Logger } from "./logging";
|
||||
import { OverlayDatabaseMode } from "./overlay-database-utils";
|
||||
import {
|
||||
OverlayDatabaseMode,
|
||||
writeBaseDatabaseOidsFile,
|
||||
writeOverlayChangesFile,
|
||||
} from "./overlay-database-utils";
|
||||
import * as setupCodeql from "./setup-codeql";
|
||||
import { ZstdAvailability } from "./tar";
|
||||
import { ToolsDownloadStatusReport } from "./tools-download";
|
||||
@@ -610,7 +614,12 @@ export async function getCodeQLForCmd(
|
||||
: "--overwrite";
|
||||
|
||||
if (overlayDatabaseMode === OverlayDatabaseMode.Overlay) {
|
||||
extraArgs.push("--overlay");
|
||||
const overlayChangesFile = await writeOverlayChangesFile(
|
||||
config,
|
||||
sourceRoot,
|
||||
logger,
|
||||
);
|
||||
extraArgs.push(`--overlay-changes=${overlayChangesFile}`);
|
||||
} else if (overlayDatabaseMode === OverlayDatabaseMode.OverlayBase) {
|
||||
extraArgs.push("--overlay-base");
|
||||
}
|
||||
@@ -636,6 +645,10 @@ export async function getCodeQLForCmd(
|
||||
],
|
||||
{ stdin: externalRepositoryToken },
|
||||
);
|
||||
|
||||
if (overlayDatabaseMode === OverlayDatabaseMode.OverlayBase) {
|
||||
await writeBaseDatabaseOidsFile(config, sourceRoot);
|
||||
}
|
||||
},
|
||||
async runAutobuild(config: Config, language: Language) {
|
||||
applyAutobuildAzurePipelinesTimeoutFix();
|
||||
|
||||
Reference in New Issue
Block a user