Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
terminal

GitHub Action

ZyAction: .NET Restore

v1.0.1

ZyAction: .NET Restore

terminal

ZyAction: .NET Restore

A GitHub Action that wraps the .NET CLI `dotnet restore` command

Installation

Copy and paste the following snippet into your .yml file.

              

- name: ZyAction: .NET Restore

uses: zyactions/[email protected]

Learn more about this action in zyactions/dotnet-restore

Choose a version

.NET Setup

License: MIT CI Ubuntu macOS Windows

A GitHub Action that wraps the .NET CLI dotnet restore command.

Features

  • 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.

Usage

Restore Packages

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.

Restore Packages for a specific Project- or Solution

steps:
  - ...
  - name: .NET Restore
    uses: zyactions/dotnet-restore@v1
    with:
      workspace: tests/Tests.sln

Inputs

workspace

The Visual Studio workspace (directory, project- or solution-file).

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

configfile

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.

ignore-failed-sources

Only warn about failed sources if there are packages meeting the version requirement.

force

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.

force-evaluate

Forces restore to reevaluate all dependencies even if a lock file already exists.

use-lock-file

Enables project lock file to be generated and used with restore.

lock-file-path

Output location where project lock file is written. By default, this is PROJECT_ROOT\packages.lock.json.

locked-mode

Don't allow updating project lock file. This is useful when deterministic builds are required.

Requirements

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:

Dependencies

This action does not use external dependencies.

Versioning

Versions follow the semantic versioning scheme.

License

.NET Restore Action is licensed under the MIT license.