mirror of
https://github.com/actions/setup-node.git
synced 2026-03-14 05:13:42 +00:00
Merge branch 'actions:main' into main
This commit is contained in:
commit
18d490a29b
BIN
.licenses/npm/@actions/cache.dep.yml
generated
BIN
.licenses/npm/@actions/cache.dep.yml
generated
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.licenses/npm/@actions/http-client-3.0.0.dep.yml
generated
Normal file
BIN
.licenses/npm/@actions/http-client-3.0.0.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@actions/io-2.0.0.dep.yml
generated
Normal file
BIN
.licenses/npm/@actions/io-2.0.0.dep.yml
generated
Normal file
Binary file not shown.
Binary file not shown.
BIN
.licenses/npm/@azure/core-auth.dep.yml
generated
BIN
.licenses/npm/@azure/core-auth.dep.yml
generated
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.licenses/npm/@azure/core-lro.dep.yml
generated
BIN
.licenses/npm/@azure/core-lro.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/core-paging.dep.yml
generated
BIN
.licenses/npm/@azure/core-paging.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/core-rest-pipeline.dep.yml
generated
Normal file
BIN
.licenses/npm/@azure/core-rest-pipeline.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/@azure/core-tracing.dep.yml
generated
BIN
.licenses/npm/@azure/core-tracing.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/core-util.dep.yml
generated
BIN
.licenses/npm/@azure/core-util.dep.yml
generated
Binary file not shown.
Binary file not shown.
BIN
.licenses/npm/@azure/logger.dep.yml
generated
BIN
.licenses/npm/@azure/logger.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/ms-rest-js.dep.yml
generated
BIN
.licenses/npm/@azure/ms-rest-js.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/storage-blob.dep.yml
generated
BIN
.licenses/npm/@azure/storage-blob.dep.yml
generated
Binary file not shown.
Binary file not shown.
BIN
.licenses/npm/@octokit/core.dep.yml
generated
BIN
.licenses/npm/@octokit/core.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@opentelemetry/api.dep.yml
generated
BIN
.licenses/npm/@opentelemetry/api.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@types/node-fetch.dep.yml
generated
BIN
.licenses/npm/@types/node-fetch.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@types/node.dep.yml
generated
BIN
.licenses/npm/@types/node.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@types/tunnel.dep.yml
generated
BIN
.licenses/npm/@types/tunnel.dep.yml
generated
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.licenses/npm/asynckit.dep.yml
generated
BIN
.licenses/npm/asynckit.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/combined-stream.dep.yml
generated
BIN
.licenses/npm/combined-stream.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/debug.dep.yml
generated
Normal file
BIN
.licenses/npm/debug.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/delayed-stream.dep.yml
generated
BIN
.licenses/npm/delayed-stream.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/es-define-property.dep.yml
generated
BIN
.licenses/npm/es-define-property.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/es-errors.dep.yml
generated
BIN
.licenses/npm/es-errors.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/es-set-tostringtag.dep.yml
generated
BIN
.licenses/npm/es-set-tostringtag.dep.yml
generated
Binary file not shown.
Binary file not shown.
BIN
.licenses/npm/form-data-2.5.5.dep.yml
generated
BIN
.licenses/npm/form-data-2.5.5.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/form-data-4.0.4.dep.yml
generated
BIN
.licenses/npm/form-data-4.0.4.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/function-bind.dep.yml
generated
BIN
.licenses/npm/function-bind.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/get-intrinsic.dep.yml
generated
BIN
.licenses/npm/get-intrinsic.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/get-proto.dep.yml
generated
BIN
.licenses/npm/get-proto.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/gopd.dep.yml
generated
BIN
.licenses/npm/gopd.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/has-symbols.dep.yml
generated
BIN
.licenses/npm/has-symbols.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/has-tostringtag.dep.yml
generated
BIN
.licenses/npm/has-tostringtag.dep.yml
generated
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.licenses/npm/math-intrinsics.dep.yml
generated
BIN
.licenses/npm/math-intrinsics.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/tr46.dep.yml → .licenses/npm/ms.dep.yml
generated
BIN
.licenses/npm/tr46.dep.yml → .licenses/npm/ms.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/node-fetch.dep.yml
generated
BIN
.licenses/npm/node-fetch.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/safe-buffer.dep.yml
generated
BIN
.licenses/npm/safe-buffer.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/sax.dep.yml
generated
BIN
.licenses/npm/sax.dep.yml
generated
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
.licenses/npm/tslib-1.14.1.dep.yml
generated
BIN
.licenses/npm/tslib-1.14.1.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/tslib-2.6.2.dep.yml
generated
BIN
.licenses/npm/tslib-2.6.2.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/tslib.dep.yml
generated
Normal file
BIN
.licenses/npm/tslib.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/webidl-conversions.dep.yml
generated
BIN
.licenses/npm/webidl-conversions.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/whatwg-url.dep.yml
generated
BIN
.licenses/npm/whatwg-url.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/xml2js.dep.yml
generated
BIN
.licenses/npm/xml2js.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/xmlbuilder.dep.yml
generated
BIN
.licenses/npm/xmlbuilder.dep.yml
generated
Binary file not shown.
40
README.md
40
README.md
@ -16,9 +16,9 @@ This action provides the following functionality for GitHub Actions users:
|
|||||||
|
|
||||||
- Caching is now automatically enabled for npm projects when either the `devEngines.packageManager` field or the top-level `packageManager` field in `package.json` is set to `npm`. For other package managers, such as Yarn and pnpm, caching is disabled by default and must be configured manually using the `cache` input.
|
- Caching is now automatically enabled for npm projects when either the `devEngines.packageManager` field or the top-level `packageManager` field in `package.json` is set to `npm`. For other package managers, such as Yarn and pnpm, caching is disabled by default and must be configured manually using the `cache` input.
|
||||||
|
|
||||||
- The `always-auth` input has been removed, as it is deprecated and will no longer be supported in future npm releases. To ensure your workflows continue to run without warnings or errors, please remove any references to `always-auth` from your configuration.
|
- The `always-auth` input has been removed, as it is deprecated and will no longer be supported in future npm releases. To ensure your workflows continue to run without warnings or errors, please remove any references to `always-auth` from your configuration.
|
||||||
|
|
||||||
## Breaking changes in V5
|
## Breaking changes in V5
|
||||||
|
|
||||||
- Enabled caching by default with package manager detection if no cache input is provided.
|
- Enabled caching by default with package manager detection if no cache input is provided.
|
||||||
> For workflows with elevated privileges or access to sensitive information, we recommend disabling automatic caching by setting `package-manager-cache: false` when caching is not needed for secure operation.
|
> For workflows with elevated privileges or access to sensitive information, we recommend disabling automatic caching by setting `package-manager-cache: false` when caching is not needed for secure operation.
|
||||||
@ -42,22 +42,22 @@ See [action.yml](action.yml)
|
|||||||
node-version: ''
|
node-version: ''
|
||||||
|
|
||||||
# File containing the version Spec of the version to use. Examples: package.json, .nvmrc, .node-version, .tool-versions.
|
# File containing the version Spec of the version to use. Examples: package.json, .nvmrc, .node-version, .tool-versions.
|
||||||
# If node-version and node-version-file are both provided the action will use version from node-version.
|
# If node-version and node-version-file are both provided the action will use version from node-version.
|
||||||
node-version-file: ''
|
node-version-file: ''
|
||||||
|
|
||||||
# Set this option if you want the action to check for the latest available version
|
# Set this option if you want the action to check for the latest available version
|
||||||
# that satisfies the version spec.
|
# that satisfies the version spec.
|
||||||
# It will only get affect for lts Nodejs versions (12.x, >=10.15.0, lts/Hydrogen).
|
# It will only get affect for lts Nodejs versions (12.x, >=10.15.0, lts/Hydrogen).
|
||||||
# Default: false
|
# Default: false
|
||||||
check-latest: false
|
check-latest: false
|
||||||
|
|
||||||
# Target architecture for Node to use. Examples: x86, x64. Will use system architecture by default.
|
# Target architecture for Node to use. Examples: x86, x64. Will use system architecture by default.
|
||||||
# Default: ''. The action use system architecture by default
|
# Default: ''. The action use system architecture by default
|
||||||
architecture: ''
|
architecture: ''
|
||||||
|
|
||||||
# Used to pull node distributions from https://github.com/actions/node-versions.
|
# Used to pull node distributions from https://github.com/actions/node-versions.
|
||||||
# Since there's a default, this is typically not supplied by the user.
|
# Since there's a default, this is typically not supplied by the user.
|
||||||
# When running this action on github.com, the default value is sufficient.
|
# When running this action on github.com, the default value is sufficient.
|
||||||
# When running on GHES, you can pass a personal access token for github.com if you are experiencing rate limiting.
|
# When running on GHES, you can pass a personal access token for github.com if you are experiencing rate limiting.
|
||||||
#
|
#
|
||||||
# We recommend using a service account with the least permissions necessary. Also
|
# We recommend using a service account with the least permissions necessary. Also
|
||||||
@ -78,18 +78,18 @@ See [action.yml](action.yml)
|
|||||||
# default: true
|
# default: true
|
||||||
package-manager-cache: true
|
package-manager-cache: true
|
||||||
|
|
||||||
# Used to specify the path to a dependency file: package-lock.json, yarn.lock, etc.
|
# Used to specify the path to a dependency file: package-lock.json, yarn.lock, etc.
|
||||||
# It will generate hash from the target file for primary key. It works only If cache is specified.
|
# It will generate hash from the target file for primary key. It works only If cache is specified.
|
||||||
# Supports wildcards or a list of file names for caching multiple dependencies.
|
# Supports wildcards or a list of file names for caching multiple dependencies.
|
||||||
# Default: ''
|
# Default: ''
|
||||||
cache-dependency-path: ''
|
cache-dependency-path: ''
|
||||||
|
|
||||||
# Optional registry to set up for auth. Will set the registry in a project level .npmrc and .yarnrc file,
|
# Optional registry to set up for auth. Will set the registry in a project level .npmrc and .yarnrc file,
|
||||||
# and set up auth to read in from env.NODE_AUTH_TOKEN.
|
# and set up auth to read in from env.NODE_AUTH_TOKEN.
|
||||||
# Default: ''
|
# Default: ''
|
||||||
registry-url: ''
|
registry-url: ''
|
||||||
|
|
||||||
# Optional scope for authenticating against scoped registries.
|
# Optional scope for authenticating against scoped registries.
|
||||||
# Will fall back to the repository owner when using the GitHub Packages registry (https://npm.pkg.github.com/).
|
# Will fall back to the repository owner when using the GitHub Packages registry (https://npm.pkg.github.com/).
|
||||||
# Default: ''
|
# Default: ''
|
||||||
scope: ''
|
scope: ''
|
||||||
@ -97,7 +97,7 @@ See [action.yml](action.yml)
|
|||||||
# Optional mirror to download binaries from.
|
# Optional mirror to download binaries from.
|
||||||
# Artifacts need to match the official Node.js
|
# Artifacts need to match the official Node.js
|
||||||
# Example:
|
# Example:
|
||||||
# V8 Canaray Build: <mirror_url>/download/v8-canary
|
# V8 Canary Build: <mirror_url>/download/v8-canary
|
||||||
# RC Build: <mirror_url>/download/rc
|
# RC Build: <mirror_url>/download/rc
|
||||||
# Official: Build <mirror_url>/dist
|
# Official: Build <mirror_url>/dist
|
||||||
# Nightly build: <mirror_url>/download/nightly
|
# Nightly build: <mirror_url>/download/nightly
|
||||||
@ -115,7 +115,7 @@ See [action.yml](action.yml)
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: 24
|
node-version: 24
|
||||||
@ -123,7 +123,7 @@ steps:
|
|||||||
- run: npm test
|
- run: npm test
|
||||||
```
|
```
|
||||||
|
|
||||||
The `node-version` input is optional. If not supplied, the node version from PATH will be used. However, it is recommended to always specify Node.js version and don't rely on the system one.
|
The `node-version` input is optional. If not supplied, the node version from PATH will be used. However, it is recommended to always specify Node.js version and not rely on the system one.
|
||||||
|
|
||||||
The action will first check the local cache for a semver match. If unable to find a specific version in the cache, the action will attempt to download a version of Node.js. It will pull LTS versions from [node-versions releases](https://github.com/actions/node-versions/releases) and on miss or failure will fall back to the previous behavior of downloading directly from [node dist](https://nodejs.org/dist/).
|
The action will first check the local cache for a semver match. If unable to find a specific version in the cache, the action will attempt to download a version of Node.js. It will pull LTS versions from [node-versions releases](https://github.com/actions/node-versions/releases) and on miss or failure will fall back to the previous behavior of downloading directly from [node dist](https://nodejs.org/dist/).
|
||||||
|
|
||||||
@ -164,7 +164,7 @@ See the examples of using cache for `yarn`/`pnpm` and `cache-dependency-path` in
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: 24
|
node-version: 24
|
||||||
@ -177,7 +177,7 @@ steps:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
node-version: 24
|
node-version: 24
|
||||||
@ -193,7 +193,7 @@ This behavior is controlled by the `package-manager-cache` input, which defaults
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- uses: actions/setup-node@v6
|
- uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
package-manager-cache: false
|
package-manager-cache: false
|
||||||
@ -212,7 +212,7 @@ jobs:
|
|||||||
node: [ 20, 22, 24 ]
|
node: [ 20, 22, 24 ]
|
||||||
name: Node ${{ matrix.node }} sample
|
name: Node ${{ matrix.node }} sample
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v6
|
||||||
- name: Setup node
|
- name: Setup node
|
||||||
uses: actions/setup-node@v6
|
uses: actions/setup-node@v6
|
||||||
with:
|
with:
|
||||||
|
|||||||
@ -26,13 +26,13 @@ inputs:
|
|||||||
cache-dependency-path:
|
cache-dependency-path:
|
||||||
description: 'Used to specify the path to a dependency file: package-lock.json, yarn.lock, etc. Supports wildcards or a list of file names for caching multiple dependencies.'
|
description: 'Used to specify the path to a dependency file: package-lock.json, yarn.lock, etc. Supports wildcards or a list of file names for caching multiple dependencies.'
|
||||||
mirror:
|
mirror:
|
||||||
description: 'Used to specify an alternative mirror to downlooad Node.js binaries from'
|
description: 'Used to specify an alternative mirror to download Node.js binaries from'
|
||||||
mirror-token:
|
mirror-token:
|
||||||
description: 'The token used as Authorization header when fetching from the mirror'
|
description: 'The token used as Authorization header when fetching from the mirror'
|
||||||
# TODO: add input to control forcing to pull from cloud or dist.
|
# TODO: add input to control forcing to pull from cloud or dist.
|
||||||
# escape valve for someone having issues or needing the absolute latest which isn't cached yet
|
# escape valve for someone having issues or needing the absolute latest which isn't cached yet
|
||||||
outputs:
|
outputs:
|
||||||
cache-hit:
|
cache-hit:
|
||||||
description: 'A boolean value to indicate if a cache was hit.'
|
description: 'A boolean value to indicate if a cache was hit.'
|
||||||
node-version:
|
node-version:
|
||||||
description: 'The installed node version.'
|
description: 'The installed node version.'
|
||||||
|
|||||||
98771
dist/cache-save/index.js
vendored
98771
dist/cache-save/index.js
vendored
File diff suppressed because one or more lines are too long
98040
dist/setup/index.js
vendored
98040
dist/setup/index.js
vendored
File diff suppressed because one or more lines are too long
@ -8,7 +8,7 @@ Currently, `actions/setup-node` supports caching dependencies for Npm and Yarn p
|
|||||||
For the first iteration, we have decided to not support cases where `package-lock.json` / `yarn.lock` are located outside of repository root.
|
For the first iteration, we have decided to not support cases where `package-lock.json` / `yarn.lock` are located outside of repository root.
|
||||||
Current implementation searches the following file patterns in the repository root: `package-lock.json`, `yarn.lock` (in order of resolving priorities)
|
Current implementation searches the following file patterns in the repository root: `package-lock.json`, `yarn.lock` (in order of resolving priorities)
|
||||||
|
|
||||||
Obviously, it made build-in caching unusable for mono-repos and repos with complex structure.
|
Obviously, it made built-in caching unusable for mono-repos and repos with complex structure.
|
||||||
We would like to revisit this decision and add customization for dependencies lock file location.
|
We would like to revisit this decision and add customization for dependencies lock file location.
|
||||||
|
|
||||||
## Proposal
|
## Proposal
|
||||||
@ -24,7 +24,7 @@ The second option looks more generic because it allows to:
|
|||||||
## Decision
|
## Decision
|
||||||
|
|
||||||
Add `cache-dependency-path` input that will accept path (relative to repository root) to dependencies lock file.
|
Add `cache-dependency-path` input that will accept path (relative to repository root) to dependencies lock file.
|
||||||
If provided path contains wildcards, the action will search all maching files and calculate common hash like `${{ hashFiles('**/package-lock.json') }}` YAML construction does.
|
If provided path contains wildcards, the action will search all matching files and calculate common hash like `${{ hashFiles('**/package-lock.json') }}` YAML construction does.
|
||||||
The hash of provided matched files will be used as a part of cache key.
|
The hash of provided matched files will be used as a part of cache key.
|
||||||
|
|
||||||
Yaml examples:
|
Yaml examples:
|
||||||
|
|||||||
@ -330,7 +330,7 @@ jobs:
|
|||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v5
|
||||||
# Restore Node.js modules cache (restore-only)
|
# Restore Node.js modules cache (restore-only)
|
||||||
- name: Restore Node modules cache
|
- name: Restore Node modules cache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v5
|
||||||
id: cache-node-modules
|
id: cache-node-modules
|
||||||
with:
|
with:
|
||||||
path: ~/.npm
|
path: ~/.npm
|
||||||
|
|||||||
2214
package-lock.json
generated
2214
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "setup-node",
|
"name": "setup-node",
|
||||||
"version": "6.0.0",
|
"version": "6.1.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "setup node action",
|
"description": "setup node action",
|
||||||
"main": "lib/setup-node.js",
|
"main": "lib/setup-node.js",
|
||||||
@ -28,7 +28,7 @@
|
|||||||
"author": "GitHub",
|
"author": "GitHub",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/cache": "^4.1.0",
|
"@actions/cache": "^5.0.1",
|
||||||
"@actions/core": "^1.11.1",
|
"@actions/core": "^1.11.1",
|
||||||
"@actions/exec": "^1.1.1",
|
"@actions/exec": "^1.1.1",
|
||||||
"@actions/github": "^6.0.1",
|
"@actions/github": "^6.0.1",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "es6", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
|
"target": "ES2022", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */
|
||||||
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
|
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */
|
||||||
"outDir": "./lib", /* Redirect output structure to the directory. */
|
"outDir": "./lib", /* Redirect output structure to the directory. */
|
||||||
"rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
"rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user