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

Access denied after update from v2 to v3 on self-hosted runner #380

Closed Michaelschnabel-DM closed 1 year ago

Michaelschnabel-DM commented 1 year ago

Description: After the update from v2 to v3 the self hosted runner has issues accessing the file C:\Program Files\dotnet\dotnet.exe, with version 2 everything worked fine.

Task version: v3

Platform:

Runner type:

Repro steps:
Repo is private

Expected behavior:

Actual behavior:

image image

panticmilos commented 1 year ago

hi @Michaelschnabel-DM, thank you for the report we will take a look at it.

dmitry-shibanov commented 1 year ago

Hello @Michaelschnabel-DM. Could you please try to use this snippet before actions/setup-dotnet:

      - run: |
          $pwshPath = which pwsh
          Write-Host $pwshPath >> $env:GITHUB_PATH

Besides, could you please try to change default PowerShell on PowerShell Core (pwsh) on your self-hosted?

134130 commented 1 year ago

Same problem on linux self-hosted. I upgraded setup-dotnet from v2 to v3.

mkdir: cannot create directory '/usr/share/dotnet': Permission denied
Michaelschnabel-DM commented 1 year ago

Hi all, specifying the DOTNET_INSTALL_DIR worked for me: image

MartinBarkerPhilips commented 5 months ago

Hi all, specifying the DOTNET_INSTALL_DIR worked for me: image

where did you add this var ?I am facing the same issue