👋 We've unified all of GitHub's product documentation in one place! Check out the content for REST API, GraphQL API, and Developers. Learn more on the GitHub blog.

Troubleshooting code scanning

You can see tips to resolve common issues with code scanning.

In this article

Note: Code scanning is currently in beta and subject to change. To request access to the beta, join the waitlist.

Automatic build for a compiled language fails

If an automatic build of code for a compiled language within your project fails, try the following troubleshooting steps.

  • Remove the autobuild action from your code scanning workflow and specify build steps. For more information, see "Configuring code scanning."
  • If the repository for your project contains code in a specific language that does not build, disable automatic language detection in your code scanning workflow and specify only the languages you want to build. For more information, see "Configuring code scanning."

Using .NET Core 2 for builds in Linux

If you scan code written in C# and you need to use .NET Core 2 for a build in Linux, invoke dotnet with /p:UseSharedCompilation=false when you build your code in your workflow's run step. The UseSharedCompilation flag isn't necessary for .NET Core 3.0 and later.

For example, the following configuration will pass the flag during the first build step.

- run: |
  dotnet build /p:UseSharedCompilation=false

For more information about specifying build steps, see "Configuring code scanning."

Error: "Server error"

If the run of a workflow for code scanning fails due to a server error, try running the workflow again. If the problem persists, contact GitHub Support or GitHub Premium Support.

Ask a human

Can't find what you're looking for?

Contact us