mirror of
https://github.com/github/codeql-action.git
synced 2026-10-30 01:27:22 +00:00
Revert src/config-utils.ts
These hunks were related to another hunk elsewhere, that has since now been reverted in favor of a separate/distinct PR.
This commit is contained in:
@@ -878,7 +878,7 @@ const mockRepositoryNwo = parseRepositoryNwo("owner/repo");
|
||||
extractor_root: "",
|
||||
};
|
||||
const codeQL = createStubCodeQL({
|
||||
resolveLanguages: () =>
|
||||
resolveLanguages: (options) =>
|
||||
Promise.resolve({
|
||||
aliases: {
|
||||
"c#": BuiltInLanguage.csharp,
|
||||
@@ -892,9 +892,11 @@ const mockRepositoryNwo = parseRepositoryNwo("owner/repo");
|
||||
java: [stubExtractorEntry],
|
||||
javascript: [stubExtractorEntry],
|
||||
python: [stubExtractorEntry],
|
||||
// `html` is an extractor without default queries. It should be
|
||||
// excluded from the supported language map.
|
||||
html: [stubExtractorEntry],
|
||||
...(options?.filterToLanguagesWithQueries
|
||||
? {}
|
||||
: {
|
||||
html: [stubExtractorEntry],
|
||||
}),
|
||||
},
|
||||
}),
|
||||
});
|
||||
|
||||
@@ -134,7 +134,9 @@ async function getSupportedLanguageMap(
|
||||
const resolveSupportedLanguagesUsingCli = await codeql.supportsFeature(
|
||||
ToolsFeature.BuiltinExtractorsSpecifyDefaultQueries,
|
||||
);
|
||||
const resolveResult = await codeql.resolveLanguages();
|
||||
const resolveResult = await codeql.resolveLanguages({
|
||||
filterToLanguagesWithQueries: resolveSupportedLanguagesUsingCli,
|
||||
});
|
||||
if (resolveSupportedLanguagesUsingCli) {
|
||||
logger.debug(
|
||||
`The CodeQL CLI supports the following languages: ${Object.keys(resolveResult.extractors).join(", ")}`,
|
||||
@@ -143,9 +145,9 @@ async function getSupportedLanguageMap(
|
||||
const supportedLanguages: Record<string, string> = {};
|
||||
// Populate canonical language names
|
||||
for (const extractor of Object.keys(resolveResult.extractors)) {
|
||||
// TODO: Delete this `if` condition once CODEQL_MINIMUM_VERSION
|
||||
// is at least v2.23.0 — the first version to support the
|
||||
// BuiltinExtractorsSpecifyDefaultQueries feature.
|
||||
// If the CLI supports resolving languages with default queries, use these
|
||||
// as the set of supported languages. Otherwise, require the language to be
|
||||
// a built-in language.
|
||||
if (
|
||||
resolveSupportedLanguagesUsingCli ||
|
||||
BuiltInLanguage[extractor] !== undefined
|
||||
|
||||
Reference in New Issue
Block a user