File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -489,13 +489,15 @@ public int run() throws IOException {
489489 diagnosticsToClose .forEach (DiagnosticWriter ::close );
490490 }
491491
492- if (!hasSeenCode ()) {
492+ // Fail extraction is no relevant files were found.
493+ if (!seenFiles || !hasSeenCode () && !EnvironmentVariables .isActionsExtractor ()) {
493494 if (seenFiles ) {
494495 warn ("Only found JavaScript or TypeScript files that were empty or contained syntax errors." );
495496 } else {
496497 warn ("No JavaScript or TypeScript code found." );
497498 }
498- // ensuring that the finalize steps detects that no code was seen.
499+ // Ensuring that the finalize steps detects that no code was seen.
500+ // This is necessary to ensure we don't produce an overlay-base database without externs.
499501 Path srcFolder = Paths .get (EnvironmentVariables .getWipDatabase (), "src" );
500502 try {
501503 FileUtil8 .recursiveDelete (srcFolder );
Original file line number Diff line number Diff line change @@ -18,6 +18,9 @@ public class EnvironmentVariables {
1818 public static final String CODEQL_EXTRACTOR_JAVASCRIPT_WIP_DATABASE_ENV_VAR =
1919 "CODEQL_EXTRACTOR_JAVASCRIPT_WIP_DATABASE" ;
2020
21+ public static final String CODEQL_EXTRACTOR_ACTIONS_WIP_DATABASE_ENV_VAR =
22+ "CODEQL_EXTRACTOR_ACTIONS_WIP_DATABASE" ;
23+
2124 public static final String CODEQL_DIST_ENV_VAR = "CODEQL_DIST" ;
2225
2326 /**
@@ -94,4 +97,8 @@ public static String getCodeQLDist() {
9497 public static String getWipDatabase () {
9598 return Env .systemEnv ().getNonEmpty (CODEQL_EXTRACTOR_JAVASCRIPT_WIP_DATABASE_ENV_VAR );
9699 }
100+
101+ public static boolean isActionsExtractor () {
102+ return Env .systemEnv ().getNonEmpty (CODEQL_EXTRACTOR_ACTIONS_WIP_DATABASE_ENV_VAR ) != null ;
103+ }
97104}
You can’t perform that action at this time.
0 commit comments