JetBrains / ReSharper-InspectCode

C# static analysis on GitHub Actions using JetBrains ReSharper InspectCode.
Other
16 stars 1 forks source link

ReSharper-InspectCode fails to install .NET 6.0 #1

Closed YourGirlInSpace closed 1 year ago

YourGirlInSpace commented 1 year ago

This is the YAML file declaring the analysis step: https://github.com/YourGirlInSpace/Instar/blob/master/.github/workflows/resharperql.yml

I am currently utilizing .NET 6.0 for this project. When attempting to run the analysis step with ReSharper-InspectCode, I receive the following error:

dotnet_install: Error: Could not find `.NET Core SDK` with version = 6.0.0
...
Error: Failed to install dotnet 1.  ...

In the previous step, I am indeed setting up .NET 6.0.x for use within the analysis. This step works perfectly fine for the build and test steps elsewhere in the repository. Please advise.

derigel23 commented 1 year ago

Hi @YourGirlInSpace First, for actions/setup-dotnet@v3 task when you specify a range version for dotnet-version you need to wrap in in apostrophe. So, in your case it will be

 - name: Setup .NET
      uses: actions/setup-dotnet@v3
      with:
        dotnet-version: '6.0.x'

Second, JetBrains/ReSharper-InspectCode github action itself also installs dotnet sdk. You can specify it explicitly with dotnet-version parameter for the action. Alternatively, you can skip to specify it explicitly and then value from global.json will be used. You have such file in your repository but it contains 6.0.0 value which is not valid version for dotnet 6.0 SDK. The first available version is 6.0.100. Current version is 6.0.401

YourGirlInSpace commented 1 year ago

First, for actions/setup-dotnet@v3 task when you specify a range version for dotnet-version you need to wrap in in apostrophe.

Noted, will update. Not sure how this got missed. Thanks for the help!