actions / setup-dotnet

Set up your GitHub Actions workflow with a specific version of the .NET core sdk
MIT License
922 stars 454 forks source link

`setup-dotnet` does not affect which version of dotnet CLI is used #354

Closed DarkWanderer closed 1 year ago

DarkWanderer commented 1 year ago

Description: With following Actions job:

jobs:
  coverage:
    name: Coverage
    runs-on: ubuntu-latest

    steps:
    - uses: actions/setup-dotnet@v3
      with:
        dotnet-version: '6.x'
    - run: dotnet --version

dotnet shows latest version - 7.0.100

Task version: v3

Platform:

Runner type:

Repro steps:
See description

Expected behavior: I would have expected dotnet to use version 6.x as specified

Actual behavior: Version 7.0.100 is run

dmitry-shibanov commented 1 year ago

Hello @DarkWanderer. Thank you for your report. I think the issue is related to this one.

DarkWanderer commented 1 year ago

Hi. Thank you for your reply. Yes, it seems like same issue. I guess I can use either a committed global.json or dotnet add globaljson --sdk-version <setup-dotnet output> to satisfy my use case. Thanks