Setup Node.js environment using actions/setup-node@v4.1.0

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/actions/setup-node?shareId=XXXX-XXXX-XXXX-XXXX).
This commit is contained in:
krp 2025-01-04 07:21:43 +09:00
parent 48b90677b6
commit ca6ea2abe0
5 changed files with 11 additions and 9 deletions

View File

@ -16,4 +16,4 @@ jobs:
name: Basic validation name: Basic validation
uses: actions/reusable-workflows/.github/workflows/basic-validation.yml@main uses: actions/reusable-workflows/.github/workflows/basic-validation.yml@main
with: with:
node-version: '20.x' node-version: 'v4.1.0'

View File

@ -16,4 +16,4 @@ jobs:
name: Check dist/ name: Check dist/
uses: actions/reusable-workflows/.github/workflows/check-dist.yml@main uses: actions/reusable-workflows/.github/workflows/check-dist.yml@main
with: with:
node-version: '20.x' node-version: 'v4.1.0'

View File

@ -18,7 +18,7 @@ See [action.yml](action.yml)
<!-- start usage --> <!-- start usage -->
```yaml ```yaml
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4.1.0
with: with:
# Version Spec of the version to use in SemVer notation. # Version Spec of the version to use in SemVer notation.
# It also admits such aliases as lts/*, latest, nightly and canary builds # It also admits such aliases as lts/*, latest, nightly and canary builds
@ -84,7 +84,7 @@ See [action.yml](action.yml)
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4.1.0
with: with:
node-version: 18 node-version: 18
- run: npm ci - run: npm ci
@ -133,7 +133,7 @@ See the examples of using cache for `yarn`/`pnpm` and `cache-dependency-path` in
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4.1.0
with: with:
node-version: 20 node-version: 20
cache: 'npm' cache: 'npm'
@ -146,7 +146,7 @@ steps:
```yaml ```yaml
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: actions/setup-node@v4 - uses: actions/setup-node@v4.1.0
with: with:
node-version: 20 node-version: 20
cache: 'npm' cache: 'npm'
@ -168,7 +168,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Setup node - name: Setup node
uses: actions/setup-node@v4 uses: actions/setup-node@v4.1.0
with: with:
node-version: ${{ matrix.node }} node-version: ${{ matrix.node }}
- run: npm ci - run: npm ci
@ -182,7 +182,7 @@ jobs:
To get a higher rate limit, you can [generate a personal access token on github.com](https://github.com/settings/tokens/new) and pass it as the `token` input for the action: To get a higher rate limit, you can [generate a personal access token on github.com](https://github.com/settings/tokens/new) and pass it as the `token` input for the action:
```yaml ```yaml
uses: actions/setup-node@v4 uses: actions/setup-node@v4.1.0
with: with:
token: ${{ secrets.GH_DOTCOM_TOKEN }} token: ${{ secrets.GH_DOTCOM_TOKEN }}
node-version: 20 node-version: 20

View File

@ -34,7 +34,8 @@
"@actions/io": "^1.0.2", "@actions/io": "^1.0.2",
"@actions/tool-cache": "^2.0.1", "@actions/tool-cache": "^2.0.1",
"semver": "^7.6.0", "semver": "^7.6.0",
"uuid": "^9.0.1" "uuid": "^9.0.1",
"actions/setup-node@v4.1.0": "^4.1.0"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^29.5.12", "@types/jest": "^29.5.12",

View File

@ -1,4 +1,5 @@
import * as core from '@actions/core'; import * as core from '@actions/core';
import * as setupNode from 'actions/setup-node@v4.1.0';
import os from 'os'; import os from 'os';