Add fallback install directory when default is not writable (#785)
* Add fallback install directory when default is not writable * Refactor macOS install directory handling to warn when default is not writable
This commit is contained in:
1 parent
62573f4b60
commit
6ec5c6b286
4 files changed
+449
-25
No files matched your search
@@ -452,7 +452,13 @@ You can also set `DOTNET_INSTALL_DIR` to a value based on runtime variables, suc
|
||||
- name: Set DOTNET_INSTALL_DIR
|
||||
run: echo "DOTNET_INSTALL_DIR=$HOME/.dotnet" >> $GITHUB_ENV
|
||||
```
|
||||
> **Note**: On some self-hosted or large Linux runners, installing .NET under the default `/usr/share/dotnet` location may fail due to insufficient permissions. To ensure successful installation, set `DOTNET_INSTALL_DIR` to a user-writable path.
|
||||
> **Note**: On some self-hosted, larger or containerized runners the default location is not writable by the current user, and the installation fails with a permission error. The action resolves the install directory in this order:
|
||||
>
|
||||
> 1. `DOTNET_INSTALL_DIR`, when set. It is always honored and never probed.
|
||||
> 2. The default location for the runner OS, when it is writable.
|
||||
> 3. `.dotnet` in the current user's home directory, for example `/home/runner/.dotnet` or `C:\Users\runneradmin\.dotnet`.
|
||||
>
|
||||
> Runners that can write to the default location are unaffected. When the fallback is used, `DOTNET_ROOT` and `PATH` point at the home directory, so .NET preinstalled under the system location is no longer picked up. Set `DOTNET_INSTALL_DIR` explicitly to pin the location. If no writable location is found, the action warns and keeps the default, so the installation is likely to fail.
|
||||
|
||||
## Recommended permissions
|
||||
|
||||
|
||||
Reference in new issue
Block a user