GeezerVison is showing github.com — Use non-root install by default · Issue #486 · actions/setup-dotnet
Use non-root install by default #486DescriptionDescription:
Non-root install in tool cache using Microsoft provided binary archives.
Justification:
self-shosted runners should be run as non-privileged user for security.
The action is unable to install dotnet without hacks, that are hard to maintain.
Are you willing to submit a PR?
I can try. Reacted by Simon Tremblay, Brandon Liles, IhateTrains, Jan Holcak, Frulfump and Kisaragi Reacted by Simon Tremblay Reacted by Simon Tremblay Activitydusan-trickovic commented on Nov 28, 2023 Hello, @SS1823 ! Thank you for your suggestion, we will take into consideration and see what can be done :) SS1823 commented on Nov 28, 2023 v-priya-kinthali commented on May 8, 2026 Hi @SS1823 👋, Thank you for this feature request!
We understand the challenge of running self-hosted runners as non-privileged users and the permission issues that can arise with the default install directory (/usr/share/dotnet).
As a workaround, you can set the DOTNET_INSTALL_DIR environment variable to a user-writable path in your workflow, which should help avoid permission errors on self-hosted Linux runners:
- name: Set DOTNET_INSTALL_DIR
run: echo "DOTNET_INSTALL_DIR=$HOME/.dotnet" >> $GITHUB_ENV
We've also added a note about this to the README in #689 for better discoverability.
This is closely related to #518, which describes the same underlying issue, permission errors when installing .NET on self-hosted runners running as non-root users.
We'll continue to explore incorporating logic into the action itself to handle permission issues gracefully in future updates. Thank you for your input! v-priyagupta108 commented on Oct 1, 2026 Hello, @SS1823,
A fix for this is up in #785. When the default install location is not writable, the action now falls back to .dotnet in the user's home directory with a warning, instead of failing with Permission denied. This addresses the permission failure for non-root users, though it does not change how .NET is downloaded or installed into the tool cache.
Let us know if this resolves the failure on your runners. Reacted by Stefan Seeland v-priyagupta108 commented on Oct 14, 2026 Hello, @SS1823,
Just checking in. Does #785 fix the failure on your non-root runners? v-priyagupta108 commented on Oct 27, 2026 Checking back on #785. It handles the permission failure for non-root installs. Does that cover your setup, or is there something it misses? v-priyagupta108 commented on Nov 2, 2026 #785 has been merged, which resolves the permission failure for non-root installs. The action now falls back to a writable location automatically rather than failing. This will be available in the next release. Closing as resolved, and please reach out to us if your runners still hit this.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|