github / codeql-action

Actions for running CodeQL analysis
MIT License
1.16k stars 321 forks source link

autobuild@v2 doesn't seem to like dotnet 7 #1380

Open Squazz opened 1 year ago

Squazz commented 1 year ago

When running autobuild on a C# project it returns the following, where .NET 7 is not among them

.NET SDKs installed: 3.1.120 [/usr/share/dotnet/sdk] 3.1.202 [/usr/share/dotnet/sdk] 3.1.302 [/usr/share/dotnet/sdk] 3.1.424 [/usr/share/dotnet/sdk] 5.0.104 [/usr/share/dotnet/sdk] 5.0.214 [/usr/share/dotnet/sdk] 5.0.303 [/usr/share/dotnet/sdk] 5.0.408 [/usr/share/dotnet/sdk] 6.0.402 [/usr/share/dotnet/sdk]

.NET runtimes installed: Microsoft.AspNetCore.App 3.1.4 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.6 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.20 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.30 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.4 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.9 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.17 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 6.0.10 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 3.1.4 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.6 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.20 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.30 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.4 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.9 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.17 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 6.0.10 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

aibaars commented 1 year ago

This looks like a duplicate of https://github.com/github/codeql/issues/11224 .

The autobuilder prints a list of installed dotnet versions. Most likely version 7 is not installed by default on the GitHub Actions workers.

Could you try adding the following before the codeql-action/init step in your workflow.

- name: Setup .NET
  uses: actions/setup-dotnet@v3
  with:
    dotnet-version: 7.0.x
Squazz commented 1 year ago

Thanks @aibaars, that solved it :)

If it's something that could be done automatically by codeql I'm unable to say. But if it was possible, it would solve it for all future versions of dotnet