Add skip-lts-prepass input to optimize .NET SDK installation process (#791)

- Introduced `skip-lts-prepass` input to allow users to skip the LTS runtime pre-pass during installation.
- Updated documentation to explain the new input and its usage.
- Enhanced tests to verify the behavior of the `skip-lts-prepass` functionality.

Co-authored-by: chiranjib-swain <chiranjib-swain@github.com>
This commit is contained in:
Chiranjib Swain
2026-10-22 03:23:54 +05:30
committed by GitHub
parent e2cf7c663b
commit 349aa191ae
8 changed files with 267 additions and 42 deletions

View File

@@ -86,6 +86,21 @@ steps:
dotnet-channel: LTS
```
## Using the `skip-lts-prepass` input
By default, `setup-dotnet` installs a minimal LTS runtime before installing the requested `dotnet-version`, to guarantee a stable `dotnet` executable is available. If your workflow doesn't need this safeguard (for example, the runner image already has a `dotnet` executable, or you're on a clean self-hosted/container environment and want to avoid the extra download), set `skip-lts-prepass: true` to install only the requested version.
```yaml
steps:
- uses: actions/checkout@v7
- uses: actions/setup-dotnet@v6
with:
dotnet-version: '9.0.x'
skip-lts-prepass: true
```
> **Note**: Setting skip-lts-prepass: true skips the LTS runtime pre-pass, so the action won't proactively install the latest LTS runtime. The existing dotnet executable and host components will be used if present; on a clean machine, they will come from the requested SDK installation. Consequently, dotnet --info may report a different Host: Version than when the pre-pass runs.
## Using the `architecture` input
Using the architecture input, it is possible to specify the required .NET SDK architecture. Possible values: `x64`, `x86`, `arm64`, `amd64`, `arm`, `s390x`, `ppc64le`, `riscv64`. If the input is not specified, the architecture defaults to the host OS architecture (not all of the architectures are available on all platforms).