actions/Setup .NET Core SDK

Used to build and publish .NET source. Set up a specific version of the .NET and authentication to private NuGet repository

View on GitHub

Trust Signals

Scorecard Score
Scorecard 6–8scored Jul 13, 2026
Maintenance Recency
Activelast commit Jun 25, 2026
License
MIT

Pinned Snippet

workflow.ymlSHA-pinned
uses: actions/setup-dotnet@26b0ec14cb23fa6904739307f278c14f94c95bf1 # v5.4.0

tags can be moved; commit SHAs can't. why a SHA?

namedescriptionrequireddefault
dotnet-versionOptional SDK version(s) to use. If not provided, will install global.json version when available. Examples: 2.2.104, 3.1, 3.1.x, 3.x, 6.0.2xx, latestno
dotnet-qualityOptional quality of the build. The possible values are: daily, preview, ga.no
dotnet-channelOptional channel for the installation. The possible values are: STS, LTS, A.B (e.g. 8.0), A.B.Cxx (e.g. 8.0.1xx, available since 5.0). To be used with "dotnet-version: latest".no
global-json-fileOptional global.json location, if your global.json isn't located in the root of the repo.no
source-urlOptional package source for which to set up authentication. Will consult any existing NuGet.config in the root of the repo and provide a temporary NuGet.config using the NUGET_AUTH_TOKEN environment variable as a ClearTextPasswordno
ownerOptional OWNER for using packages from GitHub Package Registry organizations/users other than the current repository's owner. Only used if a GPR URL is also provided in source-urlno
config-fileOptional NuGet.config location, if your NuGet.config isn't located in the root of the repo.no
cacheOptional input to enable caching of the NuGet global-packages foldernofalse
cache-dependency-pathUsed to specify the path to a dependency file: packages.lock.json. Supports wildcards or a list of file names for caching multiple dependencies.no
workloadsOptional SDK workloads to install for additional platform support. Examples: wasm-tools, maui, aspire.no
architectureOptional architecture for the .NET install. Supported values: x64, x86, arm64, amd64, arm, s390x, ppc64le, riscv64. If not set, the installer auto-detects the current system architecture.no
namedescription
cache-hitA boolean value to indicate if a cache was hit.
dotnet-versionContains the installed by action .NET SDK version for reuse.