Show answerHide answer
Correct answer: C Remove the autobuild step from your code scanning workflow and add specific build steps.
Explanation
Explanation:The CodeQL analysis workflow's autobuild step automatically attempts to compile your code for languages like C/C++, C#, and Java. If it fails, it means the automatic process could not determine the correct build commands. The proper resolution is to replace the generic autobuild with explicit, manual build steps that you know will successfully compile your codebase.
Correct Option:
C. Remove the autobuild step from your code scanning workflow and add specific build steps.
This is the direct and correct solution. By removing the failing autobuild action and replacing it with your own run: steps that execute the necessary build commands (e.g., make, msbuild, dotnet build), you give CodeQL the compiled code it needs to analyze.
Incorrect Options:
A. Remove specific build steps:
This is illogical, as the failure is with the generic autobuild. If there were already specific build steps, the autobuild likely wouldn't be needed or used.
B. Compile the source code.
While compiling is necessary, this option is too vague and is not an actionable step within the GitHub Actions workflow. It describes the goal but not the method to fix the failing workflow step.
D. Use CodeQL, which implicitly detects the supported languages in your code base.
Language detection is a separate, initial step in the CodeQL workflow and is not the cause of an autobuild failure. The failure occurs after languages are detected, during the compilation phase.
Reference:
GitHub documentation on troubleshooting CodeQL, specifically "Autobuild failed" scenarios, recommends: "If CodeQL fails to build your code... you may need to replace the autobuild step with custom build steps in your workflow."