mirror of
				https://kkgithub.com/actions/setup-node.git
				synced 2025-10-31 18:51:54 +08:00 
			
		
		
		
	Compare commits
	
		
			9 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 17f8bd9264 | |||
| b067f78ed3 | |||
| 0bd06765ef | |||
| 25184c4485 | |||
| 337fdf2194 | |||
| 86bf502a33 | |||
| 146c4d84a5 | |||
| 56337c4255 | |||
| 76d3665dc0 | 
							
								
								
									
										31
									
								
								.github/workflows/versions.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										31
									
								
								.github/workflows/versions.yml
									
									
									
									
										vendored
									
									
								
							| @ -139,3 +139,34 @@ jobs: | ||||
|       - name: Verify node | ||||
|         run: __tests__/verify-arch.sh "ia32" | ||||
|         shell: bash | ||||
|  | ||||
|   node-latest-aliases: | ||||
|     runs-on: ${{ matrix.os }} | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         os: [ubuntu-latest, windows-latest, macos-latest] | ||||
|         node-version: [current, latest, node] | ||||
|     steps: | ||||
|       - name: Get node version | ||||
|         run: | | ||||
|           latestNodeVersion=$(curl https://nodejs.org/dist/index.json | jq -r '. [0].version') | ||||
|           echo "::set-output name=LATEST_NODE_VERSION::$latestNodeVersion" | ||||
|         id: version | ||||
|         shell: bash | ||||
|       - uses: actions/checkout@v3 | ||||
|       - name: Setup Node | ||||
|         uses: ./ | ||||
|         with: | ||||
|           node-version: ${{ matrix.node-version }} | ||||
|       - name: Retrieve version after install | ||||
|         run: | | ||||
|           updatedVersion=$(echo $(node --version)) | ||||
|           echo "::set-output name=NODE_VERSION_UPDATED::$updatedVersion" | ||||
|         id: updatedVersion | ||||
|         shell: bash | ||||
|       - name: Compare versions | ||||
|         if: ${{ steps.version.outputs.LATEST_NODE_VERSION != steps.updatedVersion.outputs.NODE_VERSION_UPDATED}} | ||||
|         run: | | ||||
|           echo "Latest node version failed to download." | ||||
|           exit 1 | ||||
|  | ||||
							
								
								
									
										2
									
								
								.licenses/npm/@actions/cache.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								.licenses/npm/@actions/cache.dep.yml
									
									
									
										generated
									
									
									
								
							| @ -1,6 +1,6 @@ | ||||
| --- | ||||
| name: "@actions/cache" | ||||
| version: 2.0.0 | ||||
| version: 2.0.2 | ||||
| type: npm | ||||
| summary: Actions cache lib | ||||
| homepage: https://github.com/actions/toolkit/tree/main/packages/cache | ||||
|  | ||||
| @ -1,32 +1,32 @@ | ||||
| --- | ||||
| name: "@azure/core-asynciterator-polyfill" | ||||
| version: 1.0.0 | ||||
| version: 1.0.2 | ||||
| type: npm | ||||
| summary: Polyfill for IE/Node 8 for Symbol.asyncIterator | ||||
| homepage: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/core-asynciterator-polyfill | ||||
| homepage: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/core-asynciterator-polyfill/README.md | ||||
| license: mit | ||||
| licenses: | ||||
| - sources: LICENSE | ||||
|   text: |2 | ||||
|         MIT License | ||||
|   text: | | ||||
|     The MIT License (MIT) | ||||
|  | ||||
|         Copyright (c) Microsoft Corporation. All rights reserved. | ||||
|     Copyright (c) 2020 Microsoft | ||||
|  | ||||
|         Permission is hereby granted, free of charge, to any person obtaining a copy | ||||
|         of this software and associated documentation files (the "Software"), to deal | ||||
|         in the Software without restriction, including without limitation the rights | ||||
|         to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||||
|         copies of the Software, and to permit persons to whom the Software is | ||||
|         furnished to do so, subject to the following conditions: | ||||
|     Permission is hereby granted, free of charge, to any person obtaining a copy | ||||
|     of this software and associated documentation files (the "Software"), to deal | ||||
|     in the Software without restriction, including without limitation the rights | ||||
|     to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||||
|     copies of the Software, and to permit persons to whom the Software is | ||||
|     furnished to do so, subject to the following conditions: | ||||
|  | ||||
|         The above copyright notice and this permission notice shall be included in all | ||||
|         copies or substantial portions of the Software. | ||||
|     The above copyright notice and this permission notice shall be included in all | ||||
|     copies or substantial portions of the Software. | ||||
|  | ||||
|         THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||||
|         IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||||
|         FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||||
|         AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||||
|         LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||||
|         OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||||
|         SOFTWARE | ||||
|     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||||
|     IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||||
|     FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||||
|     AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||||
|     LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||||
|     OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||||
|     SOFTWARE. | ||||
| notices: [] | ||||
|  | ||||
							
								
								
									
										2
									
								
								.licenses/npm/@azure/core-http.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								.licenses/npm/@azure/core-http.dep.yml
									
									
									
										generated
									
									
									
								
							| @ -1,6 +1,6 @@ | ||||
| --- | ||||
| name: "@azure/core-http" | ||||
| version: 2.2.2 | ||||
| version: 2.2.4 | ||||
| type: npm | ||||
| summary: Isomorphic client Runtime for Typescript/node.js/browser javascript client | ||||
|   libraries generated using AutoRest | ||||
|  | ||||
							
								
								
									
										2
									
								
								.licenses/npm/@azure/core-lro.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								.licenses/npm/@azure/core-lro.dep.yml
									
									
									
										generated
									
									
									
								
							| @ -1,6 +1,6 @@ | ||||
| --- | ||||
| name: "@azure/core-lro" | ||||
| version: 2.2.1 | ||||
| version: 2.2.4 | ||||
| type: npm | ||||
| summary: Isomorphic client library for supporting long-running operations in node.js | ||||
|   and browser. | ||||
|  | ||||
							
								
								
									
										2
									
								
								.licenses/npm/@azure/core-paging.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								.licenses/npm/@azure/core-paging.dep.yml
									
									
									
										generated
									
									
									
								
							| @ -1,6 +1,6 @@ | ||||
| --- | ||||
| name: "@azure/core-paging" | ||||
| version: 1.2.0 | ||||
| version: 1.2.1 | ||||
| type: npm | ||||
| summary: Core types for paging async iterable iterators | ||||
| homepage: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/core-paging/README.md | ||||
|  | ||||
							
								
								
									
										2
									
								
								.licenses/npm/@azure/ms-rest-js.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								.licenses/npm/@azure/ms-rest-js.dep.yml
									
									
									
										generated
									
									
									
								
							| @ -1,6 +1,6 @@ | ||||
| --- | ||||
| name: "@azure/ms-rest-js" | ||||
| version: 2.6.0 | ||||
| version: 2.6.1 | ||||
| type: npm | ||||
| summary: Isomorphic client Runtime for Typescript/node.js/browser javascript client | ||||
|   libraries generated using AutoRest | ||||
|  | ||||
							
								
								
									
										2
									
								
								.licenses/npm/@azure/storage-blob.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								.licenses/npm/@azure/storage-blob.dep.yml
									
									
									
										generated
									
									
									
								
							| @ -1,6 +1,6 @@ | ||||
| --- | ||||
| name: "@azure/storage-blob" | ||||
| version: 12.8.0 | ||||
| version: 12.9.0 | ||||
| type: npm | ||||
| summary: Microsoft Azure Storage SDK for JavaScript - Blob | ||||
| homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storage/storage-blob/ | ||||
|  | ||||
							
								
								
									
										6
									
								
								.licenses/npm/@opentelemetry/api.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										6
									
								
								.licenses/npm/@opentelemetry/api.dep.yml
									
									
									
										generated
									
									
									
								
							| @ -1,6 +1,6 @@ | ||||
| --- | ||||
| name: "@opentelemetry/api" | ||||
| version: 1.0.3 | ||||
| version: 1.0.4 | ||||
| type: npm | ||||
| summary: Public API for OpenTelemetry | ||||
| homepage: https://github.com/open-telemetry/opentelemetry-js-api#readme | ||||
| @ -218,10 +218,6 @@ licenses: | ||||
|     [discussions-url]: https://github.com/open-telemetry/opentelemetry-js/discussions | ||||
|     [license-url]: https://github.com/open-telemetry/opentelemetry-js-api/blob/main/LICENSE | ||||
|     [license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat | ||||
|     [dependencies-image]: https://status.david-dm.org/gh/open-telemetry/opentelemetry-js-api.svg | ||||
|     [dependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js-api | ||||
|     [devDependencies-image]: https://status.david-dm.org/gh/open-telemetry/opentelemetry-js-api.svg?type=dev | ||||
|     [devDependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js-api?type=dev | ||||
|     [npm-url]: https://www.npmjs.com/package/@opentelemetry/api | ||||
|     [npm-img]: https://badge.fury.io/js/%40opentelemetry%2Fapi.svg | ||||
|     [docs-tracing]: https://github.com/open-telemetry/opentelemetry-js-api/blob/main/docs/tracing.md | ||||
|  | ||||
							
								
								
									
										2
									
								
								.licenses/npm/@types/node-fetch.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								.licenses/npm/@types/node-fetch.dep.yml
									
									
									
										generated
									
									
									
								
							| @ -1,6 +1,6 @@ | ||||
| --- | ||||
| name: "@types/node-fetch" | ||||
| version: 2.5.12 | ||||
| version: 2.6.1 | ||||
| type: npm | ||||
| summary: TypeScript definitions for node-fetch | ||||
| homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-fetch | ||||
|  | ||||
							
								
								
									
										47
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										47
									
								
								README.md
									
									
									
									
									
								
							| @ -11,7 +11,7 @@ This action provides the following functionality for GitHub Actions users: | ||||
| - Registering problem matchers for error output | ||||
| - Configuring authentication for GPR or npm | ||||
|  | ||||
| # Usage | ||||
| ## Usage | ||||
|  | ||||
| See [action.yml](action.yml) | ||||
|  | ||||
| @ -22,8 +22,8 @@ steps: | ||||
| - uses: actions/checkout@v3 | ||||
| - uses: actions/setup-node@v3 | ||||
|   with: | ||||
|     node-version: '14' | ||||
| - run: npm install | ||||
|     node-version: 14 | ||||
| - run: npm ci | ||||
| - run: npm test | ||||
| ``` | ||||
|  | ||||
| @ -33,21 +33,30 @@ The action will first check the local cache for a semver match. If unable to fin | ||||
|  | ||||
| For information regarding locally cached versions of Node.js on GitHub hosted runners, check out [GitHub Actions Virtual Environments](https://github.com/actions/virtual-environments). | ||||
|  | ||||
| #### Supported version syntax | ||||
| ### Supported version syntax | ||||
|  | ||||
| The `node-version` input supports the following syntax: | ||||
|  | ||||
| major versions: `12`, `14`, `16` | ||||
| more specific versions: `10.15`, `14.2.0`, `16.3.0` | ||||
| nvm lts syntax: `lts/erbium`, `lts/fermium`, `lts/*` | ||||
| latest release: `latest`/`current`/`node` | ||||
|  | ||||
| ## Caching packages dependencies | ||||
| **Note:** Since the latest release will not be cached always, there is possibility of hitting rate limit when downloading from dist | ||||
|  | ||||
| The action has a built-in functionality for caching and restoring dependencies. It uses [actions/cache](https://github.com/actions/cache) under the hood for caching dependencies but requires less configuration settings. Supported package managers are `npm`, `yarn`, `pnpm` (v6.10+). The `cache` input is optional, and caching is turned off by default. | ||||
| ### Checking in lockfiles | ||||
|  | ||||
| It's **always** recommended to commit the lockfile of your package manager for security and performance reasons. For more information consult the "Working with lockfiles" section of the [Advanced usage](docs/advanced-usage.md#working-with-lockfiles) guide. | ||||
|  | ||||
| ## Caching global packages data | ||||
|  | ||||
| The action has a built-in functionality for caching and restoring dependencies. It uses [actions/cache](https://github.com/actions/cache) under the hood for caching global packages data but requires less configuration settings. Supported package managers are `npm`, `yarn`, `pnpm` (v6.10+). The `cache` input is optional, and caching is turned off by default. | ||||
|  | ||||
| The action defaults to search for the dependency file (`package-lock.json` or `yarn.lock`) in the repository root, and uses its hash as a part of the cache key. Use `cache-dependency-path` for cases when multiple dependency files are used, or they are located in different subdirectories. | ||||
|  | ||||
| See the examples of using cache for `yarn` / `pnpm` and  `cache-dependency-path` input in the [Advanced usage](docs/advanced-usage.md#caching-packages-dependencies) guide. | ||||
| **Note:** The action does not cache `node_modules` | ||||
|  | ||||
| See the examples of using cache for `yarn`/`pnpm` and `cache-dependency-path` input in the [Advanced usage](docs/advanced-usage.md#caching-packages-data) guide. | ||||
|  | ||||
| **Caching npm dependencies:** | ||||
|  | ||||
| @ -56,9 +65,9 @@ steps: | ||||
| - uses: actions/checkout@v3 | ||||
| - uses: actions/setup-node@v3 | ||||
|   with: | ||||
|     node-version: '14' | ||||
|     node-version: 14 | ||||
|     cache: 'npm' | ||||
| - run: npm install | ||||
| - run: npm ci | ||||
| - run: npm test | ||||
| ``` | ||||
|  | ||||
| @ -69,14 +78,14 @@ steps: | ||||
| - uses: actions/checkout@v3 | ||||
| - uses: actions/setup-node@v3 | ||||
|   with: | ||||
|     node-version: '14' | ||||
|     node-version: 14 | ||||
|     cache: 'npm' | ||||
|     cache-dependency-path: subdir/package-lock.json | ||||
| - run: npm install | ||||
| - run: npm ci | ||||
| - run: npm test | ||||
| ``` | ||||
|  | ||||
| ## Matrix Testing: | ||||
| ## Matrix Testing | ||||
|  | ||||
| ```yaml | ||||
| jobs: | ||||
| @ -84,7 +93,7 @@ jobs: | ||||
|     runs-on: ubuntu-latest | ||||
|     strategy: | ||||
|       matrix: | ||||
|         node: [ '12', '14', '16' ] | ||||
|         node: [ 12, 14, 16 ] | ||||
|     name: Node ${{ matrix.node }} sample | ||||
|     steps: | ||||
|       - uses: actions/checkout@v3 | ||||
| @ -92,7 +101,7 @@ jobs: | ||||
|         uses: actions/setup-node@v3 | ||||
|         with: | ||||
|           node-version: ${{ matrix.node }} | ||||
|       - run: npm install | ||||
|       - run: npm ci | ||||
|       - run: npm test | ||||
| ``` | ||||
|  | ||||
| @ -101,20 +110,20 @@ jobs: | ||||
| 1. [Check latest version](docs/advanced-usage.md#check-latest-version) | ||||
| 2. [Using a node version file](docs/advanced-usage.md#node-version-file) | ||||
| 3. [Using different architectures](docs/advanced-usage.md#architecture) | ||||
| 4. [Caching packages dependencies](docs/advanced-usage.md#caching-packages-dependencies) | ||||
| 4. [Caching packages data](docs/advanced-usage.md#caching-packages-data) | ||||
| 5. [Using multiple operating systems and architectures](docs/advanced-usage.md#multiple-operating-systems-and-architectures) | ||||
| 6. [Publishing to npmjs and GPR with npm](docs/advanced-usage.md#publish-to-npmjs-and-gpr-with-npm) | ||||
| 7. [Publishing to npmjs and GPR with yarn](docs/advanced-usage.md#publish-to-npmjs-and-gpr-with-yarn) | ||||
| 8. [Using private packages](docs/advanced-usage.md#use-private-packages) | ||||
|  | ||||
| # License | ||||
| ## License | ||||
|  | ||||
| The scripts and documentation in this project are released under the [MIT License](LICENSE) | ||||
|  | ||||
| # Contributions | ||||
| ## Contributions | ||||
|  | ||||
| Contributions are welcome!  See [Contributor's Guide](docs/contributors.md) | ||||
| Contributions are welcome! See [Contributor's Guide](docs/contributors.md) | ||||
|  | ||||
| ## Code of Conduct | ||||
|  | ||||
| :wave: Be nice.  See [our code of conduct](CONDUCT) | ||||
| :wave: Be nice. See [our code of conduct](CODE_OF_CONDUCT.md) | ||||
|  | ||||
| @ -909,4 +909,30 @@ describe('setup-node', () => { | ||||
|       ); | ||||
|     }); | ||||
|   }); | ||||
|  | ||||
|   describe('latest alias syntax', () => { | ||||
|     it.each(['latest', 'current', 'node'])( | ||||
|       'download the %s version if alias is provided', | ||||
|       async inputVersion => { | ||||
|         // Arrange | ||||
|         inputs['node-version'] = inputVersion; | ||||
|  | ||||
|         os.platform = 'darwin'; | ||||
|         os.arch = 'x64'; | ||||
|  | ||||
|         findSpy.mockImplementation(() => ''); | ||||
|         getManifestSpy.mockImplementation(() => { | ||||
|           throw new Error('Unable to download manifest'); | ||||
|         }); | ||||
|  | ||||
|         // Act | ||||
|         await main.run(); | ||||
|  | ||||
|         // assert | ||||
|         expect(logSpy).toHaveBeenCalledWith('Unable to download manifest'); | ||||
|  | ||||
|         expect(logSpy).toHaveBeenCalledWith('getting latest node version...'); | ||||
|       } | ||||
|     ); | ||||
|   }); | ||||
| }); | ||||
|  | ||||
							
								
								
									
										18
									
								
								action.yml
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								action.yml
									
									
									
									
									
								
							| @ -1,35 +1,35 @@ | ||||
| name: 'Setup Node.js environment' | ||||
| description: 'Setup a Node.js environment by adding problem matchers and optionally downloading and adding it to the PATH' | ||||
| description: 'Setup a Node.js environment by adding problem matchers and optionally downloading and adding it to the PATH.' | ||||
| author: 'GitHub' | ||||
| inputs: | ||||
|   always-auth: | ||||
|     description: 'Set always-auth in npmrc' | ||||
|     description: 'Set always-auth in npmrc.' | ||||
|     default: 'false' | ||||
|   node-version: | ||||
|     description: 'Version Spec of the version to use.  Examples: 12.x, 10.15.1, >=10.15.0' | ||||
|     description: 'Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0.' | ||||
|   node-version-file: | ||||
|     description: 'File containing the version Spec of the version to use.  Examples: .nvmrc, .node-version' | ||||
|     description: 'File containing the version Spec of the version to use.  Examples: .nvmrc, .node-version.' | ||||
|   architecture: | ||||
|     description: 'Target architecture for Node to use. Examples: x86, x64. Will use system architecture by default.' | ||||
|   check-latest: | ||||
|     description: 'Set this option if you want the action to check for the latest available version that satisfies the version spec' | ||||
|     description: 'Set this option if you want the action to check for the latest available version that satisfies the version spec.' | ||||
|     default: false | ||||
|   registry-url: | ||||
|     description: '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' | ||||
|     description: '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.' | ||||
|   scope: | ||||
|     description: 'Optional scope for authenticating against scoped registries' | ||||
|     description: '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/).' | ||||
|   token: | ||||
|     description: Used to pull node distributions from node-versions.  Since there's a default, this is typically not supplied by the user. | ||||
|     default: ${{ github.token }} | ||||
|   cache: | ||||
|     description: 'Used to specify a package manager for caching in the default directory. Supported values: npm, yarn, pnpm' | ||||
|     description: 'Used to specify a package manager for caching in the default directory. Supported values: npm, yarn, pnpm.' | ||||
|   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.' | ||||
| # 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 | ||||
| outputs: | ||||
|   cache-hit:  | ||||
|     description: 'A boolean value to indicate if a cache was hit' | ||||
|     description: 'A boolean value to indicate if a cache was hit.' | ||||
| runs: | ||||
|   using: 'node16' | ||||
|   main: 'dist/setup/index.js' | ||||
|  | ||||
							
								
								
									
										9022
									
								
								dist/cache-save/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										9022
									
								
								dist/cache-save/index.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										5210
									
								
								dist/setup/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5210
									
								
								dist/setup/index.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -1,4 +1,38 @@ | ||||
| # Advanced usage | ||||
| ## Working with lockfiles | ||||
|  | ||||
| All supported package managers recommend that you **always** commit the lockfile, although implementations vary doing so generally provides the following benefits: | ||||
|  | ||||
| - Enables faster installation for CI and production environments, due to being able to skip package resolution. | ||||
| - Describes a single representation of a dependency tree such that teammates, deployments, and continuous integration are guaranteed to install exactly the same dependencies. | ||||
| - Provides a facility for users to "time-travel" to previous states of `node_modules` without having to commit the directory itself. | ||||
| - Facilitates greater visibility of tree changes through readable source control diffs. | ||||
|  | ||||
| In order to get the most out of using your lockfile on continuous integration follow the conventions outlined below for your respective package manager. | ||||
|  | ||||
| ### NPM | ||||
|  | ||||
| Ensure that `package-lock.json` is always committed, use `npm ci` instead of `npm install` when installing packages. | ||||
|  | ||||
| **See also:** | ||||
| - [Documentation of `package-lock.json`](https://docs.npmjs.com/cli/v8/configuring-npm/package-lock-json) | ||||
| - [Documentation of `npm ci`](https://docs.npmjs.com/cli/v8/commands/npm-ci) | ||||
|  | ||||
| ### Yarn | ||||
|  | ||||
| Ensure that `yarn.lock` is always committed, pass `--frozen-lockfile` to `yarn install` when installing packages. | ||||
|  | ||||
| **See also:** | ||||
| - [Documentation of `yarn.lock`](https://classic.yarnpkg.com/en/docs/yarn-lock) | ||||
| - [Documentation of `--frozen-lockfile` option](https://classic.yarnpkg.com/en/docs/cli/install#toc-yarn-install-frozen-lockfile) | ||||
| - [QA - Should lockfiles be committed to the repoistory?](https://yarnpkg.com/getting-started/qa/#should-lockfiles-be-committed-to-the-repository) | ||||
|  | ||||
| ### PNPM | ||||
|  | ||||
| Ensure that `pnpm-lock.yaml` is always committed, when on CI pass `--frozen-lockfile` to `pnpm install` when installing packages. | ||||
|  | ||||
| **See also:** | ||||
| - [Working with Git - Lockfiles](https://pnpm.io/git#lockfiles) | ||||
| - [Documentation of `--frozen-lockfile` option](https://pnpm.io/cli/install#--frozen-lockfile) | ||||
|  | ||||
| ## Check latest version | ||||
|  | ||||
| @ -15,7 +49,7 @@ steps: | ||||
|   with: | ||||
|     node-version: '14' | ||||
|     check-latest: true | ||||
| - run: npm install | ||||
| - run: npm ci | ||||
| - run: npm test | ||||
| ``` | ||||
|  | ||||
| @ -31,7 +65,7 @@ steps: | ||||
| - uses: actions/setup-node@v3 | ||||
|   with: | ||||
|     node-version-file: '.nvmrc' | ||||
| - run: npm install | ||||
| - run: npm ci | ||||
| - run: npm test | ||||
| ``` | ||||
|  | ||||
| @ -51,11 +85,11 @@ jobs: | ||||
|         with: | ||||
|           node-version: '14' | ||||
|           architecture: 'x64' # optional, x64 or x86. If not specified, x64 will be used by default | ||||
|       - run: npm install | ||||
|       - run: npm ci | ||||
|       - run: npm test | ||||
| ``` | ||||
|  | ||||
| ## Caching packages dependencies | ||||
| ## Caching packages data | ||||
| The action follows [actions/cache](https://github.com/actions/cache/blob/main/examples.md#node---npm) guidelines, and caches global cache on the machine instead of `node_modules`, so cache can be reused between different Node.js versions. | ||||
|  | ||||
| **Caching yarn dependencies:** | ||||
| @ -67,7 +101,7 @@ steps: | ||||
|   with: | ||||
|     node-version: '14' | ||||
|     cache: 'yarn' | ||||
| - run: yarn install | ||||
| - run: yarn install --frozen-lockfile | ||||
| - run: yarn test | ||||
| ``` | ||||
|  | ||||
| @ -82,14 +116,14 @@ steps: | ||||
|  | ||||
| steps: | ||||
| - uses: actions/checkout@v3 | ||||
| - uses: pnpm/action-setup@646cdf48217256a3d0b80361c5a50727664284f2 | ||||
| - uses: pnpm/action-setup@v2 | ||||
|   with: | ||||
|     version: 6.10.0 | ||||
|     version: 6.32.9 | ||||
| - uses: actions/setup-node@v3 | ||||
|   with: | ||||
|     node-version: '14' | ||||
|     cache: 'pnpm' | ||||
| - run: pnpm install | ||||
| - run: pnpm install --frozen-lockfile | ||||
| - run: pnpm test | ||||
| ``` | ||||
|  | ||||
| @ -102,7 +136,7 @@ steps: | ||||
|     node-version: '14' | ||||
|     cache: 'npm' | ||||
|     cache-dependency-path: '**/package-lock.json' | ||||
| - run: npm install | ||||
| - run: npm ci | ||||
| - run: npm test | ||||
| ``` | ||||
|  | ||||
| @ -117,7 +151,7 @@ steps: | ||||
|     cache-dependency-path: | | ||||
|       server/app/package-lock.json | ||||
|       frontend/app/package-lock.json | ||||
| - run: npm install | ||||
| - run: npm ci | ||||
| - run: npm test | ||||
| ``` | ||||
|  | ||||
| @ -152,7 +186,7 @@ jobs: | ||||
|         with: | ||||
|           node-version: ${{ matrix.node_version }} | ||||
|           architecture: ${{ matrix.architecture }} | ||||
|       - run: npm install | ||||
|       - run: npm ci | ||||
|       - run: npm test | ||||
| ``` | ||||
|  | ||||
| @ -164,7 +198,7 @@ steps: | ||||
|   with: | ||||
|     node-version: '14.x' | ||||
|     registry-url: 'https://registry.npmjs.org' | ||||
| - run: npm install | ||||
| - run: npm ci | ||||
| - run: npm publish | ||||
|   env: | ||||
|     NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||||
| @ -184,7 +218,7 @@ steps: | ||||
|   with: | ||||
|     node-version: '14.x' | ||||
|     registry-url: <registry url> | ||||
| - run: yarn install | ||||
| - run: yarn install --frozen-lockfile | ||||
| - run: yarn publish | ||||
|   env: | ||||
|     NODE_AUTH_TOKEN: ${{ secrets.YARN_TOKEN }} | ||||
| @ -206,7 +240,7 @@ steps: | ||||
|     registry-url: 'https://registry.npmjs.org' | ||||
| # Skip post-install scripts here, as a malicious | ||||
| # script could steal NODE_AUTH_TOKEN. | ||||
| - run: npm install --ignore-scripts | ||||
| - run: npm ci --ignore-scripts | ||||
|   env: | ||||
|     NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||||
| # `npm rebuild` will run all those post-install scripts for us. | ||||
|  | ||||
							
								
								
									
										125
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										125
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							| @ -1,15 +1,15 @@ | ||||
| { | ||||
|   "name": "setup-node", | ||||
|   "version": "3.1.0", | ||||
|   "version": "3.1.1", | ||||
|   "lockfileVersion": 2, | ||||
|   "requires": true, | ||||
|   "packages": { | ||||
|     "": { | ||||
|       "name": "setup-node", | ||||
|       "version": "3.1.0", | ||||
|       "version": "3.1.1", | ||||
|       "license": "MIT", | ||||
|       "dependencies": { | ||||
|         "@actions/cache": "^2.0.0", | ||||
|         "@actions/cache": "^2.0.2", | ||||
|         "@actions/core": "^1.6.0", | ||||
|         "@actions/exec": "^1.1.0", | ||||
|         "@actions/github": "^1.1.0", | ||||
| @ -32,9 +32,9 @@ | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/@actions/cache": { | ||||
|       "version": "2.0.0", | ||||
|       "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-2.0.0.tgz", | ||||
|       "integrity": "sha512-d7n8ul6HjWX6oDrNEPoqn8ZvqyyDhp9Uek6WOxALyxGVsXU+8+ND+viD3UfrXVWfs/GQiqI5Eq4cOozZj0yRFQ==", | ||||
|       "version": "2.0.2", | ||||
|       "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-2.0.2.tgz", | ||||
|       "integrity": "sha512-K1DCaW/OtHj5mV7hI7HEXiceX3rM4Nc0iG2hfYsrkEy6GiOeqlCC/LyICrBZIRDM6+vSrS12tg1ORl4hghomBA==", | ||||
|       "dependencies": { | ||||
|         "@actions/core": "^1.2.6", | ||||
|         "@actions/exec": "^1.0.1", | ||||
| @ -142,9 +142,12 @@ | ||||
|       "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" | ||||
|     }, | ||||
|     "node_modules/@azure/core-asynciterator-polyfill": { | ||||
|       "version": "1.0.0", | ||||
|       "resolved": "https://registry.npmjs.org/@azure/core-asynciterator-polyfill/-/core-asynciterator-polyfill-1.0.0.tgz", | ||||
|       "integrity": "sha512-kmv8CGrPfN9SwMwrkiBK9VTQYxdFQEGe0BmQk+M8io56P9KNzpAxcWE/1fxJj7uouwN4kXF0BHW8DNlgx+wtCg==" | ||||
|       "version": "1.0.2", | ||||
|       "resolved": "https://registry.npmjs.org/@azure/core-asynciterator-polyfill/-/core-asynciterator-polyfill-1.0.2.tgz", | ||||
|       "integrity": "sha512-3rkP4LnnlWawl0LZptJOdXNrT/fHp2eQMadoasa6afspXdpGrtPZuAQc2PD0cpgyuoXtUWyC3tv7xfntjGS5Dw==", | ||||
|       "engines": { | ||||
|         "node": ">=12.0.0" | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/@azure/core-auth": { | ||||
|       "version": "1.3.2", | ||||
| @ -164,9 +167,9 @@ | ||||
|       "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" | ||||
|     }, | ||||
|     "node_modules/@azure/core-http": { | ||||
|       "version": "2.2.2", | ||||
|       "resolved": "https://registry.npmjs.org/@azure/core-http/-/core-http-2.2.2.tgz", | ||||
|       "integrity": "sha512-V1DdoO9V/sFimKpdWoNBgsE+QUjQgpXYnxrTdUp5RyhsTJjvEVn/HKmTQXIHuLUUo6IyIWj+B+Dg4VaXse9dIA==", | ||||
|       "version": "2.2.4", | ||||
|       "resolved": "https://registry.npmjs.org/@azure/core-http/-/core-http-2.2.4.tgz", | ||||
|       "integrity": "sha512-QmmJmexXKtPyc3/rsZR/YTLDvMatzbzAypJmLzvlfxgz/SkgnqV/D4f6F2LsK6tBj1qhyp8BoXiOebiej0zz3A==", | ||||
|       "dependencies": { | ||||
|         "@azure/abort-controller": "^1.0.0", | ||||
|         "@azure/core-asynciterator-polyfill": "^1.0.0", | ||||
| @ -176,7 +179,7 @@ | ||||
|         "@types/node-fetch": "^2.5.0", | ||||
|         "@types/tunnel": "^0.0.3", | ||||
|         "form-data": "^4.0.0", | ||||
|         "node-fetch": "^2.6.0", | ||||
|         "node-fetch": "^2.6.7", | ||||
|         "process": "^0.11.10", | ||||
|         "tough-cookie": "^4.0.0", | ||||
|         "tslib": "^2.2.0", | ||||
| @ -215,9 +218,9 @@ | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/@azure/core-lro": { | ||||
|       "version": "2.2.1", | ||||
|       "resolved": "https://registry.npmjs.org/@azure/core-lro/-/core-lro-2.2.1.tgz", | ||||
|       "integrity": "sha512-HE6PBl+mlKa0eBsLwusHqAqjLc5n9ByxeDo3Hz4kF3B1hqHvRkBr4oMgoT6tX7Hc3q97KfDctDUon7EhvoeHPA==", | ||||
|       "version": "2.2.4", | ||||
|       "resolved": "https://registry.npmjs.org/@azure/core-lro/-/core-lro-2.2.4.tgz", | ||||
|       "integrity": "sha512-e1I2v2CZM0mQo8+RSix0x091Av493e4bnT22ds2fcQGslTHzM2oTbswkB65nP4iEpCxBrFxOSDPKExmTmjCVtQ==", | ||||
|       "dependencies": { | ||||
|         "@azure/abort-controller": "^1.0.0", | ||||
|         "@azure/core-tracing": "1.0.0-preview.13", | ||||
| @ -234,9 +237,9 @@ | ||||
|       "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" | ||||
|     }, | ||||
|     "node_modules/@azure/core-paging": { | ||||
|       "version": "1.2.0", | ||||
|       "resolved": "https://registry.npmjs.org/@azure/core-paging/-/core-paging-1.2.0.tgz", | ||||
|       "integrity": "sha512-ZX1bCjm/MjKPCN6kQD/9GJErYSoKA8YWp6YWoo5EIzcTWlSBLXu3gNaBTUl8usGl+UShiKo7b4Gdy1NSTIlpZg==", | ||||
|       "version": "1.2.1", | ||||
|       "resolved": "https://registry.npmjs.org/@azure/core-paging/-/core-paging-1.2.1.tgz", | ||||
|       "integrity": "sha512-UtH5iMlYsvg+nQYIl4UHlvvSrsBjOlRF4fs0j7mxd3rWdAStrKYrh2durOpHs5C9yZbVhsVDaisoyaf/lL1EVA==", | ||||
|       "dependencies": { | ||||
|         "@azure/core-asynciterator-polyfill": "^1.0.0", | ||||
|         "tslib": "^2.2.0" | ||||
| @ -284,14 +287,14 @@ | ||||
|       "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" | ||||
|     }, | ||||
|     "node_modules/@azure/ms-rest-js": { | ||||
|       "version": "2.6.0", | ||||
|       "resolved": "https://registry.npmjs.org/@azure/ms-rest-js/-/ms-rest-js-2.6.0.tgz", | ||||
|       "integrity": "sha512-4C5FCtvEzWudblB+h92/TYYPiq7tuElX8icVYToxOdggnYqeec4Se14mjse5miInKtZahiFHdl8lZA/jziEc5g==", | ||||
|       "version": "2.6.1", | ||||
|       "resolved": "https://registry.npmjs.org/@azure/ms-rest-js/-/ms-rest-js-2.6.1.tgz", | ||||
|       "integrity": "sha512-LLi4jRe/qy5IM8U2CkoDgSZp2OH+MgDe2wePmhz8uY84Svc53EhHaamVyoU6BjjHBxvCRh1vcD1urJDccrxqIw==", | ||||
|       "dependencies": { | ||||
|         "@azure/core-auth": "^1.1.4", | ||||
|         "abort-controller": "^3.0.0", | ||||
|         "form-data": "^2.5.0", | ||||
|         "node-fetch": "^2.6.0", | ||||
|         "node-fetch": "^2.6.7", | ||||
|         "tough-cookie": "^3.0.1", | ||||
|         "tslib": "^1.10.0", | ||||
|         "tunnel": "0.0.6", | ||||
| @ -334,9 +337,9 @@ | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/@azure/storage-blob": { | ||||
|       "version": "12.8.0", | ||||
|       "resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-12.8.0.tgz", | ||||
|       "integrity": "sha512-c8+Wz19xauW0bGkTCoqZH4dYfbtBniPiGiRQOn1ca6G5jsjr4azwaTk9gwjVY8r3vY2Taf95eivLzipfIfiS4A==", | ||||
|       "version": "12.9.0", | ||||
|       "resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-12.9.0.tgz", | ||||
|       "integrity": "sha512-ank38FdCLfJ+EoeMzCz3hkYJuZAd63ARvDKkxZYRDb+beBYf+/+gx8jNTqkq/hfyUl4dJQ/a7tECU0Y0F98CHg==", | ||||
|       "dependencies": { | ||||
|         "@azure/abort-controller": "^1.0.0", | ||||
|         "@azure/core-http": "^2.0.0", | ||||
| @ -1359,9 +1362,9 @@ | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/@opentelemetry/api": { | ||||
|       "version": "1.0.3", | ||||
|       "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.0.3.tgz", | ||||
|       "integrity": "sha512-puWxACExDe9nxbBB3lOymQFrLYml2dVOrd7USiVRnSbgXE+KwBu+HxFvxrzfqsiSda9IWsXJG1ef7C1O2/GmKQ==", | ||||
|       "version": "1.0.4", | ||||
|       "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.0.4.tgz", | ||||
|       "integrity": "sha512-BuJuXRSJNQ3QoKA6GWWDyuLpOUck+9hAXNMCnrloc1aWVoy6Xq6t9PUV08aBZ4Lutqq2LEHM486bpZqoViScog==", | ||||
|       "engines": { | ||||
|         "node": ">=8.0.0" | ||||
|       } | ||||
| @ -1483,9 +1486,9 @@ | ||||
|       "integrity": "sha512-NrTwfD7L1RTc2qrHQD4RTTy4p0CO2LatKBEKEds3CaVuhoM/+DJzmWZl5f+ikR8cm8F5mfJxK+9rQq07gRiSjQ==" | ||||
|     }, | ||||
|     "node_modules/@types/node-fetch": { | ||||
|       "version": "2.5.12", | ||||
|       "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.12.tgz", | ||||
|       "integrity": "sha512-MKgC4dlq4kKNa/mYrwpKfzQMB5X3ee5U6fSprkKpToBqBmX4nFZL9cW5jl6sWn+xpRJ7ypWh2yyqqr8UUCstSw==", | ||||
|       "version": "2.6.1", | ||||
|       "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.1.tgz", | ||||
|       "integrity": "sha512-oMqjURCaxoSIsHSr1E47QHzbmzNR5rK8McHuNb11BOM9cHcIK3Avy0s/b2JlXHoQGTYS3NsvWzV1M0iK7l0wbA==", | ||||
|       "dependencies": { | ||||
|         "@types/node": "*", | ||||
|         "form-data": "^3.0.0" | ||||
| @ -5077,9 +5080,9 @@ | ||||
|   }, | ||||
|   "dependencies": { | ||||
|     "@actions/cache": { | ||||
|       "version": "2.0.0", | ||||
|       "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-2.0.0.tgz", | ||||
|       "integrity": "sha512-d7n8ul6HjWX6oDrNEPoqn8ZvqyyDhp9Uek6WOxALyxGVsXU+8+ND+viD3UfrXVWfs/GQiqI5Eq4cOozZj0yRFQ==", | ||||
|       "version": "2.0.2", | ||||
|       "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-2.0.2.tgz", | ||||
|       "integrity": "sha512-K1DCaW/OtHj5mV7hI7HEXiceX3rM4Nc0iG2hfYsrkEy6GiOeqlCC/LyICrBZIRDM6+vSrS12tg1ORl4hghomBA==", | ||||
|       "requires": { | ||||
|         "@actions/core": "^1.2.6", | ||||
|         "@actions/exec": "^1.0.1", | ||||
| @ -5184,9 +5187,9 @@ | ||||
|       } | ||||
|     }, | ||||
|     "@azure/core-asynciterator-polyfill": { | ||||
|       "version": "1.0.0", | ||||
|       "resolved": "https://registry.npmjs.org/@azure/core-asynciterator-polyfill/-/core-asynciterator-polyfill-1.0.0.tgz", | ||||
|       "integrity": "sha512-kmv8CGrPfN9SwMwrkiBK9VTQYxdFQEGe0BmQk+M8io56P9KNzpAxcWE/1fxJj7uouwN4kXF0BHW8DNlgx+wtCg==" | ||||
|       "version": "1.0.2", | ||||
|       "resolved": "https://registry.npmjs.org/@azure/core-asynciterator-polyfill/-/core-asynciterator-polyfill-1.0.2.tgz", | ||||
|       "integrity": "sha512-3rkP4LnnlWawl0LZptJOdXNrT/fHp2eQMadoasa6afspXdpGrtPZuAQc2PD0cpgyuoXtUWyC3tv7xfntjGS5Dw==" | ||||
|     }, | ||||
|     "@azure/core-auth": { | ||||
|       "version": "1.3.2", | ||||
| @ -5205,9 +5208,9 @@ | ||||
|       } | ||||
|     }, | ||||
|     "@azure/core-http": { | ||||
|       "version": "2.2.2", | ||||
|       "resolved": "https://registry.npmjs.org/@azure/core-http/-/core-http-2.2.2.tgz", | ||||
|       "integrity": "sha512-V1DdoO9V/sFimKpdWoNBgsE+QUjQgpXYnxrTdUp5RyhsTJjvEVn/HKmTQXIHuLUUo6IyIWj+B+Dg4VaXse9dIA==", | ||||
|       "version": "2.2.4", | ||||
|       "resolved": "https://registry.npmjs.org/@azure/core-http/-/core-http-2.2.4.tgz", | ||||
|       "integrity": "sha512-QmmJmexXKtPyc3/rsZR/YTLDvMatzbzAypJmLzvlfxgz/SkgnqV/D4f6F2LsK6tBj1qhyp8BoXiOebiej0zz3A==", | ||||
|       "requires": { | ||||
|         "@azure/abort-controller": "^1.0.0", | ||||
|         "@azure/core-asynciterator-polyfill": "^1.0.0", | ||||
| @ -5217,7 +5220,7 @@ | ||||
|         "@types/node-fetch": "^2.5.0", | ||||
|         "@types/tunnel": "^0.0.3", | ||||
|         "form-data": "^4.0.0", | ||||
|         "node-fetch": "^2.6.0", | ||||
|         "node-fetch": "^2.6.7", | ||||
|         "process": "^0.11.10", | ||||
|         "tough-cookie": "^4.0.0", | ||||
|         "tslib": "^2.2.0", | ||||
| @ -5249,9 +5252,9 @@ | ||||
|       } | ||||
|     }, | ||||
|     "@azure/core-lro": { | ||||
|       "version": "2.2.1", | ||||
|       "resolved": "https://registry.npmjs.org/@azure/core-lro/-/core-lro-2.2.1.tgz", | ||||
|       "integrity": "sha512-HE6PBl+mlKa0eBsLwusHqAqjLc5n9ByxeDo3Hz4kF3B1hqHvRkBr4oMgoT6tX7Hc3q97KfDctDUon7EhvoeHPA==", | ||||
|       "version": "2.2.4", | ||||
|       "resolved": "https://registry.npmjs.org/@azure/core-lro/-/core-lro-2.2.4.tgz", | ||||
|       "integrity": "sha512-e1I2v2CZM0mQo8+RSix0x091Av493e4bnT22ds2fcQGslTHzM2oTbswkB65nP4iEpCxBrFxOSDPKExmTmjCVtQ==", | ||||
|       "requires": { | ||||
|         "@azure/abort-controller": "^1.0.0", | ||||
|         "@azure/core-tracing": "1.0.0-preview.13", | ||||
| @ -5267,9 +5270,9 @@ | ||||
|       } | ||||
|     }, | ||||
|     "@azure/core-paging": { | ||||
|       "version": "1.2.0", | ||||
|       "resolved": "https://registry.npmjs.org/@azure/core-paging/-/core-paging-1.2.0.tgz", | ||||
|       "integrity": "sha512-ZX1bCjm/MjKPCN6kQD/9GJErYSoKA8YWp6YWoo5EIzcTWlSBLXu3gNaBTUl8usGl+UShiKo7b4Gdy1NSTIlpZg==", | ||||
|       "version": "1.2.1", | ||||
|       "resolved": "https://registry.npmjs.org/@azure/core-paging/-/core-paging-1.2.1.tgz", | ||||
|       "integrity": "sha512-UtH5iMlYsvg+nQYIl4UHlvvSrsBjOlRF4fs0j7mxd3rWdAStrKYrh2durOpHs5C9yZbVhsVDaisoyaf/lL1EVA==", | ||||
|       "requires": { | ||||
|         "@azure/core-asynciterator-polyfill": "^1.0.0", | ||||
|         "tslib": "^2.2.0" | ||||
| @ -5314,14 +5317,14 @@ | ||||
|       } | ||||
|     }, | ||||
|     "@azure/ms-rest-js": { | ||||
|       "version": "2.6.0", | ||||
|       "resolved": "https://registry.npmjs.org/@azure/ms-rest-js/-/ms-rest-js-2.6.0.tgz", | ||||
|       "integrity": "sha512-4C5FCtvEzWudblB+h92/TYYPiq7tuElX8icVYToxOdggnYqeec4Se14mjse5miInKtZahiFHdl8lZA/jziEc5g==", | ||||
|       "version": "2.6.1", | ||||
|       "resolved": "https://registry.npmjs.org/@azure/ms-rest-js/-/ms-rest-js-2.6.1.tgz", | ||||
|       "integrity": "sha512-LLi4jRe/qy5IM8U2CkoDgSZp2OH+MgDe2wePmhz8uY84Svc53EhHaamVyoU6BjjHBxvCRh1vcD1urJDccrxqIw==", | ||||
|       "requires": { | ||||
|         "@azure/core-auth": "^1.1.4", | ||||
|         "abort-controller": "^3.0.0", | ||||
|         "form-data": "^2.5.0", | ||||
|         "node-fetch": "^2.6.0", | ||||
|         "node-fetch": "^2.6.7", | ||||
|         "tough-cookie": "^3.0.1", | ||||
|         "tslib": "^1.10.0", | ||||
|         "tunnel": "0.0.6", | ||||
| @ -5357,9 +5360,9 @@ | ||||
|       } | ||||
|     }, | ||||
|     "@azure/storage-blob": { | ||||
|       "version": "12.8.0", | ||||
|       "resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-12.8.0.tgz", | ||||
|       "integrity": "sha512-c8+Wz19xauW0bGkTCoqZH4dYfbtBniPiGiRQOn1ca6G5jsjr4azwaTk9gwjVY8r3vY2Taf95eivLzipfIfiS4A==", | ||||
|       "version": "12.9.0", | ||||
|       "resolved": "https://registry.npmjs.org/@azure/storage-blob/-/storage-blob-12.9.0.tgz", | ||||
|       "integrity": "sha512-ank38FdCLfJ+EoeMzCz3hkYJuZAd63ARvDKkxZYRDb+beBYf+/+gx8jNTqkq/hfyUl4dJQ/a7tECU0Y0F98CHg==", | ||||
|       "requires": { | ||||
|         "@azure/abort-controller": "^1.0.0", | ||||
|         "@azure/core-http": "^2.0.0", | ||||
| @ -6177,9 +6180,9 @@ | ||||
|       } | ||||
|     }, | ||||
|     "@opentelemetry/api": { | ||||
|       "version": "1.0.3", | ||||
|       "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.0.3.tgz", | ||||
|       "integrity": "sha512-puWxACExDe9nxbBB3lOymQFrLYml2dVOrd7USiVRnSbgXE+KwBu+HxFvxrzfqsiSda9IWsXJG1ef7C1O2/GmKQ==" | ||||
|       "version": "1.0.4", | ||||
|       "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.0.4.tgz", | ||||
|       "integrity": "sha512-BuJuXRSJNQ3QoKA6GWWDyuLpOUck+9hAXNMCnrloc1aWVoy6Xq6t9PUV08aBZ4Lutqq2LEHM486bpZqoViScog==" | ||||
|     }, | ||||
|     "@sinonjs/commons": { | ||||
|       "version": "1.8.3", | ||||
| @ -6295,9 +6298,9 @@ | ||||
|       "integrity": "sha512-NrTwfD7L1RTc2qrHQD4RTTy4p0CO2LatKBEKEds3CaVuhoM/+DJzmWZl5f+ikR8cm8F5mfJxK+9rQq07gRiSjQ==" | ||||
|     }, | ||||
|     "@types/node-fetch": { | ||||
|       "version": "2.5.12", | ||||
|       "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.12.tgz", | ||||
|       "integrity": "sha512-MKgC4dlq4kKNa/mYrwpKfzQMB5X3ee5U6fSprkKpToBqBmX4nFZL9cW5jl6sWn+xpRJ7ypWh2yyqqr8UUCstSw==", | ||||
|       "version": "2.6.1", | ||||
|       "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.1.tgz", | ||||
|       "integrity": "sha512-oMqjURCaxoSIsHSr1E47QHzbmzNR5rK8McHuNb11BOM9cHcIK3Avy0s/b2JlXHoQGTYS3NsvWzV1M0iK7l0wbA==", | ||||
|       "requires": { | ||||
|         "@types/node": "*", | ||||
|         "form-data": "^3.0.0" | ||||
|  | ||||
| @ -1,6 +1,6 @@ | ||||
| { | ||||
|   "name": "setup-node", | ||||
|   "version": "3.1.0", | ||||
|   "version": "3.1.1", | ||||
|   "private": true, | ||||
|   "description": "setup node action", | ||||
|   "main": "lib/setup-node.js", | ||||
| @ -23,7 +23,7 @@ | ||||
|   "author": "GitHub", | ||||
|   "license": "MIT", | ||||
|   "dependencies": { | ||||
|     "@actions/cache": "^2.0.0", | ||||
|     "@actions/cache": "^2.0.2", | ||||
|     "@actions/core": "^1.6.0", | ||||
|     "@actions/exec": "^1.1.0", | ||||
|     "@actions/github": "^1.1.0", | ||||
|  | ||||
| @ -373,6 +373,15 @@ async function queryDistForMatch( | ||||
|   let versions: string[] = []; | ||||
|   let nodeVersions = await getVersionsFromDist(); | ||||
|  | ||||
|   if ( | ||||
|     versionSpec === 'current' || | ||||
|     versionSpec === 'latest' || | ||||
|     versionSpec === 'node' | ||||
|   ) { | ||||
|     core.info(`getting latest node version...`); | ||||
|     return nodeVersions[0].version; | ||||
|   } | ||||
|  | ||||
|   nodeVersions.forEach((nodeVersion: INodeVersion) => { | ||||
|     // ensure this version supports your os and platform | ||||
|     if (nodeVersion.files.indexOf(dataFileName) >= 0) { | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	