GitHub Action
ZyAction: .NET Restore
A GitHub Action that wraps the .NET CLI dotnet restore
command.
- Wraps the
dotnet restore
.NET CLI command- Provides a structured way of using this command in a workflow
- Supports all platforms (Linux, macOS, Windows)
Note
This action provides a wrapper around the
dotnet restore
.NET CLI command. For further details, please check out the official documentation.
steps:
- ...
- name: .NET Restore
uses: zyactions/dotnet-restore@v1
The dotnet restore
command automatically searches for a Visual Studio Solution file (*.sln
) in the repository root.
steps:
- ...
- name: .NET Restore
uses: zyactions/dotnet-restore@v1
with:
working-directory: test
workspace: Tests.sln
The working-directory for the action.
Defaults to the repository root directory (github.workspace
).
Note
If a specific .NET SDK version is to be used, the working directory must point to the directory that contains the
global.json
or a subdirectory of it.
The Visual Studio workspace (directory, project- or solution-file).
This path is relative to the working-directory
unless an absolute path is used.
The dotnet restore
command automatically searches for a Visual Studio Solution file (*.sln
) in the specified workspace directory, if no explicit solution- or project- file is specified.
Example values:
path/to/workspace
path/to/Solution.sln
path/to/Project.csproj
The NuGet configuration file (nuget.config) to use. If specified, only the settings from this file will be used. If not specified, the hierarchy of configuration files from the current directory will be used. For more information, see Common NuGet Configurations.
Only warn about failed sources if there are packages meeting the version requirement.
Forces all dependencies to be resolved even if the last restore was successful. Specifying this flag is the same as deleting the project.assets.json
file.
Forces restore
to reevaluate all dependencies even if a lock file already exists.
Enables project lock file to be generated and used with restore.
Output location where project lock file is written. By default, this is PROJECT_ROOT\packages.lock.json
.
Don't allow updating project lock file. This is useful when deterministic builds are required.
The .NET CLI needs to be installed on the runner. To be independent from the GitHub defaults, it's recommended to install a specific version of the SDK prior to calling this action.
To install the .NET SDK in your workflow, the following actions can be used:
This action does not use external dependencies.
Versions follow the semantic versioning scheme.
.NET Restore Action is licensed under the MIT license.