Skip to content

Commit

Permalink
refactor(dotnet): skip Node.js setup if no version specified
Browse files Browse the repository at this point in the history
npm allows you to install packages for ASP.NET Core applications.

Some ASP.NET Core applications might require a specific version of npm and Node.js to be installed. If yes, this workflow should install the specified versions (already implemented). Else, this workflow should skip the setup of npm (already implemented) and Node.js (implemented in this commit).
  • Loading branch information
hknutsen committed Jan 6, 2025
1 parent 3875f9c commit decd131
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@ on:
required: true

node_version:
description: The version of Node.js to install.
description: A specific version of Node.js to install. Use to override pre-installed version on GitHub-hosted runners.
type: string
required: false
default: latest

npm_version:
description: A specific version of npm to install. Use to override pre-installed version on GitHub-hosted runners.
Expand Down Expand Up @@ -92,6 +91,7 @@ jobs:
dotnet-version: ${{ inputs.dotnet_version }}

- name: Setup Node.js
if: inputs.node_version != ''
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
with:
node-version: ${{ inputs.node_version }}
Expand Down

0 comments on commit decd131

Please sign in to comment.