mirror of
https://github.com/github/codeql.git
synced 2026-04-28 18:25:24 +02:00
Actions: dont fail if no JS/TS code was found
This commit is contained in:
@@ -489,13 +489,15 @@ public class AutoBuild {
|
||||
diagnosticsToClose.forEach(DiagnosticWriter::close);
|
||||
}
|
||||
|
||||
if (!hasSeenCode()) {
|
||||
// Fail extraction is no relevant files were found.
|
||||
if (!seenFiles || !hasSeenCode() && !EnvironmentVariables.isActionsExtractor()) {
|
||||
if (seenFiles) {
|
||||
warn("Only found JavaScript or TypeScript files that were empty or contained syntax errors.");
|
||||
} else {
|
||||
warn("No JavaScript or TypeScript code found.");
|
||||
}
|
||||
// ensuring that the finalize steps detects that no code was seen.
|
||||
// Ensuring that the finalize steps detects that no code was seen.
|
||||
// This is necessary to ensure we don't produce an overlay-base database without externs.
|
||||
Path srcFolder = Paths.get(EnvironmentVariables.getWipDatabase(), "src");
|
||||
try {
|
||||
FileUtil8.recursiveDelete(srcFolder);
|
||||
|
||||
@@ -18,6 +18,9 @@ public class EnvironmentVariables {
|
||||
public static final String CODEQL_EXTRACTOR_JAVASCRIPT_WIP_DATABASE_ENV_VAR =
|
||||
"CODEQL_EXTRACTOR_JAVASCRIPT_WIP_DATABASE";
|
||||
|
||||
public static final String CODEQL_EXTRACTOR_ACTIONS_WIP_DATABASE_ENV_VAR =
|
||||
"CODEQL_EXTRACTOR_ACTIONS_WIP_DATABASE";
|
||||
|
||||
public static final String CODEQL_DIST_ENV_VAR = "CODEQL_DIST";
|
||||
|
||||
/**
|
||||
@@ -94,4 +97,8 @@ public class EnvironmentVariables {
|
||||
public static String getWipDatabase() {
|
||||
return Env.systemEnv().getNonEmpty(CODEQL_EXTRACTOR_JAVASCRIPT_WIP_DATABASE_ENV_VAR);
|
||||
}
|
||||
|
||||
public static boolean isActionsExtractor() {
|
||||
return Env.systemEnv().getNonEmpty(CODEQL_EXTRACTOR_ACTIONS_WIP_DATABASE_ENV_VAR) != null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user