Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/entry-points.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion src/cli-errors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,17 +224,25 @@ test("wrapCliConfigurationError - init called twice", (t) => {
});

test("wrapCliConfigurationError - no source code seen by exit code", (t) => {
const diagnostic =
"CodeQL detected code written in JavaScript/TypeScript, but not any written in Python.";
const commandError = new CommandInvocationError(
"codeql",
["database", "finalize"],
32,
"Some other error message",
diagnostic,
);
const cliError = new CliError(commandError);

const wrappedError = wrapCliConfigurationError(cliError);

t.true(wrappedError instanceof ConfigurationError);
t.true(wrappedError.message.includes(diagnostic));
t.true(
wrappedError.message.includes(
"set the `languages` input on the `init` step to the languages you want to analyze.",
),
);
});

test("wrapCliConfigurationError - no source code seen by message", (t) => {
Expand Down
3 changes: 3 additions & 0 deletions src/cli-errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ const cliErrorsConfig: Record<CliConfigErrorCategory, CliErrorConfiguration> = {
"CodeQL did not detect any code written in languages supported by CodeQL",
),
],
additionalErrorMessageToAppend:
"If automatic language detection selected a language that is absent from the checkout, " +
"set the `languages` input on the `init` step to the languages you want to analyze.",
},
[CliConfigErrorCategory.NoSupportedBuildCommandSucceeded]: {
cliErrorMessageCandidates: [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- The CodeQL Action now suggests setting the `languages` input when automatic language detection selects a language that is absent from the checkout and CodeQL reports that it saw no source code. [#4335](https://github.com/github/codeql-action/pull/4335)