mirror of
				https://gitea.com/actions/setup-node.git
				synced 2025-10-29 07:47:20 +00:00 
			
		
		
		
	Compare commits
	
		
			11 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | bea5baf987 | ||
| ![dependabot[bot]](/assets/img/avatar_default.png)  | d82f92a0eb | ||
|   | ca2d4e0cdd | ||
|   | c7a93deeac | ||
|   | 34050076a5 | ||
|   | f8aa08ed8e | ||
|   | e2d34eacc8 | ||
| ![dependabot[bot]](/assets/img/avatar_default.png)  | ef9c88b169 | ||
| ![dependabot[bot]](/assets/img/avatar_default.png)  | ea800d4ebc | ||
|   | cb95c398f6 | ||
|   | 69b2dd252e | 
							
								
								
									
										2
									
								
								.github/workflows/check-dist.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/check-dist.yml
									
									
									
									
										vendored
									
									
								
							| @@ -1,4 +1,4 @@ | ||||
| name: Check dist/ | ||||
| name: Check dist | ||||
|  | ||||
| on: | ||||
|   push: | ||||
|   | ||||
							
								
								
									
										2
									
								
								.github/workflows/e2e-cache.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/e2e-cache.yml
									
									
									
									
										vendored
									
									
								
							| @@ -173,7 +173,7 @@ jobs: | ||||
|       - uses: actions/checkout@v3 | ||||
|  | ||||
|       - name: prepare sub-projects | ||||
|         run: __tests__/prepare-yarn-subprojects.sh | ||||
|         run: __tests__/prepare-yarn-subprojects.sh keepcache keepcache | ||||
|  | ||||
|       # expect | ||||
|       #  - no errors | ||||
|   | ||||
							
								
								
									
										3
									
								
								.github/workflows/versions.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.github/workflows/versions.yml
									
									
									
									
										vendored
									
									
								
							| @@ -158,7 +158,8 @@ jobs: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         os: [ubuntu-latest, windows-latest, macos-latest] | ||||
|         node-version-file: [.nvmrc, .tool-versions, package.json] | ||||
|         node-version-file: | ||||
|           [.nvmrc, .tool-versions, .tool-versions-node, package.json] | ||||
|     steps: | ||||
|       - uses: actions/checkout@v3 | ||||
|       - name: Remove volta from package.json | ||||
|   | ||||
							
								
								
									
										2
									
								
								.licenses/npm/@actions/cache.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								.licenses/npm/@actions/cache.dep.yml
									
									
									
										generated
									
									
									
								
							| @@ -1,6 +1,6 @@ | ||||
| --- | ||||
| name: "@actions/cache" | ||||
| version: 3.0.4 | ||||
| version: 3.2.1 | ||||
| type: npm | ||||
| summary: Actions cache lib | ||||
| homepage: https://github.com/actions/toolkit/tree/main/packages/cache | ||||
|   | ||||
							
								
								
									
										4
									
								
								.licenses/npm/@azure/abort-controller.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										4
									
								
								.licenses/npm/@azure/abort-controller.dep.yml
									
									
									
										generated
									
									
									
								
							| @@ -1,9 +1,9 @@ | ||||
| --- | ||||
| name: "@azure/abort-controller" | ||||
| version: 1.0.4 | ||||
| version: 1.1.0 | ||||
| type: npm | ||||
| summary: Microsoft Azure SDK for JavaScript - Aborter | ||||
| homepage: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/abort-controller/README.md | ||||
| homepage: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/abort-controller/README.md | ||||
| license: mit | ||||
| licenses: | ||||
| - sources: LICENSE | ||||
|   | ||||
							
								
								
									
										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.6 | ||||
| version: 2.7.0 | ||||
| type: npm | ||||
| summary: Isomorphic client Runtime for Typescript/node.js/browser javascript client | ||||
|   libraries generated using AutoRest | ||||
|   | ||||
							
								
								
									
										34
									
								
								.licenses/npm/ip-regex.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										34
									
								
								.licenses/npm/ip-regex.dep.yml
									
									
									
										generated
									
									
									
								
							| @@ -1,34 +0,0 @@ | ||||
| --- | ||||
| name: ip-regex | ||||
| version: 2.1.0 | ||||
| type: npm | ||||
| summary: Regular expression for matching IP addresses (IPv4 & IPv6) | ||||
| homepage: https://github.com/sindresorhus/ip-regex#readme | ||||
| license: mit | ||||
| licenses: | ||||
| - sources: license | ||||
|   text: | | ||||
|     The MIT License (MIT) | ||||
| 
 | ||||
|     Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com) | ||||
| 
 | ||||
|     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 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. | ||||
| - sources: readme.md | ||||
|   text: MIT © [Sindre Sorhus](https://sindresorhus.com) | ||||
| notices: [] | ||||
							
								
								
									
										43
									
								
								.licenses/npm/psl.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										43
									
								
								.licenses/npm/psl.dep.yml
									
									
									
										generated
									
									
									
								
							| @@ -1,43 +0,0 @@ | ||||
| --- | ||||
| name: psl | ||||
| version: 1.8.0 | ||||
| type: npm | ||||
| summary: Domain name parser based on the Public Suffix List | ||||
| homepage: https://github.com/lupomontero/psl#readme | ||||
| license: mit | ||||
| licenses: | ||||
| - sources: LICENSE | ||||
|   text: | | ||||
|     The MIT License (MIT) | ||||
| 
 | ||||
|     Copyright (c) 2017 Lupo Montero lupomontero@gmail.com | ||||
| 
 | ||||
|     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 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. | ||||
| - sources: README.md | ||||
|   text: |- | ||||
|     The MIT License (MIT) | ||||
| 
 | ||||
|     Copyright (c) 2017 Lupo Montero <lupomontero@gmail.com> | ||||
| 
 | ||||
|     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 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: [] | ||||
							
								
								
									
										34
									
								
								.licenses/npm/punycode.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										34
									
								
								.licenses/npm/punycode.dep.yml
									
									
									
										generated
									
									
									
								
							| @@ -1,34 +0,0 @@ | ||||
| --- | ||||
| name: punycode | ||||
| version: 2.1.1 | ||||
| type: npm | ||||
| summary: A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, | ||||
|   and works on nearly all JavaScript platforms. | ||||
| homepage: https://mths.be/punycode | ||||
| license: mit | ||||
| licenses: | ||||
| - sources: LICENSE-MIT.txt | ||||
|   text: | | ||||
|     Copyright Mathias Bynens <https://mathiasbynens.be/> | ||||
| 
 | ||||
|     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 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. | ||||
| - sources: README.md | ||||
|   text: Punycode.js is available under the [MIT](https://mths.be/mit) license. | ||||
| notices: [] | ||||
| @@ -1,9 +1,9 @@ | ||||
| --- | ||||
| name: semver | ||||
| version: 6.1.2 | ||||
| version: 6.3.1 | ||||
| type: npm | ||||
| summary: The semantic version parser used by npm. | ||||
| homepage: https://github.com/npm/node-semver#readme | ||||
| homepage:  | ||||
| license: isc | ||||
| licenses: | ||||
| - sources: LICENSE | ||||
							
								
								
									
										23
									
								
								.licenses/npm/tough-cookie.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										23
									
								
								.licenses/npm/tough-cookie.dep.yml
									
									
									
										generated
									
									
									
								
							| @@ -1,23 +0,0 @@ | ||||
| --- | ||||
| name: tough-cookie | ||||
| version: 3.0.1 | ||||
| type: npm | ||||
| summary: RFC6265 Cookies and Cookie Jar for node.js | ||||
| homepage: https://github.com/salesforce/tough-cookie | ||||
| license: bsd-3-clause | ||||
| licenses: | ||||
| - sources: LICENSE | ||||
|   text: | | ||||
|     Copyright (c) 2015, Salesforce.com, Inc. | ||||
|     All rights reserved. | ||||
| 
 | ||||
|     Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | ||||
| 
 | ||||
|     1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | ||||
| 
 | ||||
|     2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | ||||
| 
 | ||||
|     3. Neither the name of Salesforce.com nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. | ||||
| 
 | ||||
|     THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||
| notices: [] | ||||
| @@ -99,7 +99,7 @@ For information regarding locally cached versions of Node.js on GitHub hosted ru | ||||
|  | ||||
| ### Supported version syntax | ||||
|  | ||||
| The `node-version` input supports the Semantic Versioning Specification, for more detailed examples please refer to the [documentation](https://github.com/npm/node-semver). | ||||
| The `node-version` input supports the Semantic Versioning Specification, for more detailed examples please refer to [the semver package documentation](https://github.com/npm/node-semver). | ||||
|  | ||||
| Examples: | ||||
|  | ||||
|   | ||||
| @@ -92,6 +92,9 @@ describe('run', () => { | ||||
|  | ||||
|     it('Package manager is not valid, skip caching', async () => { | ||||
|       inputs['cache'] = 'yarn3'; | ||||
|       getStateSpy.mockImplementation(key => | ||||
|         key === State.CachePackageManager ? inputs['cache'] : '' | ||||
|       ); | ||||
|  | ||||
|       await run(); | ||||
|  | ||||
| @@ -108,7 +111,9 @@ describe('run', () => { | ||||
|     it('should not save cache for yarn1', async () => { | ||||
|       inputs['cache'] = 'yarn'; | ||||
|       getStateSpy.mockImplementation(key => | ||||
|         key === State.CachePrimaryKey || key === State.CacheMatchedKey | ||||
|         key === State.CachePackageManager | ||||
|           ? inputs['cache'] | ||||
|           : key === State.CachePrimaryKey || key === State.CacheMatchedKey | ||||
|           ? yarnFileHash | ||||
|           : key === State.CachePaths | ||||
|           ? '["/foo/bar"]' | ||||
| @@ -117,8 +122,8 @@ describe('run', () => { | ||||
|  | ||||
|       await run(); | ||||
|  | ||||
|       expect(getInputSpy).toHaveBeenCalled(); | ||||
|       expect(getStateSpy).toHaveBeenCalledTimes(3); | ||||
|       expect(getInputSpy).not.toHaveBeenCalled(); | ||||
|       expect(getStateSpy).toHaveBeenCalledTimes(4); | ||||
|       expect(getCommandOutputSpy).toHaveBeenCalledTimes(0); | ||||
|       expect(debugSpy).toHaveBeenCalledTimes(0); | ||||
|       expect(infoSpy).toHaveBeenCalledWith( | ||||
| @@ -130,7 +135,9 @@ describe('run', () => { | ||||
|     it('should not save cache for yarn2', async () => { | ||||
|       inputs['cache'] = 'yarn'; | ||||
|       getStateSpy.mockImplementation(key => | ||||
|         key === State.CachePrimaryKey || key === State.CacheMatchedKey | ||||
|         key === State.CachePackageManager | ||||
|           ? inputs['cache'] | ||||
|           : key === State.CachePrimaryKey || key === State.CacheMatchedKey | ||||
|           ? yarnFileHash | ||||
|           : key === State.CachePaths | ||||
|           ? '["/foo/bar"]' | ||||
| @@ -139,8 +146,8 @@ describe('run', () => { | ||||
|  | ||||
|       await run(); | ||||
|  | ||||
|       expect(getInputSpy).toHaveBeenCalled(); | ||||
|       expect(getStateSpy).toHaveBeenCalledTimes(3); | ||||
|       expect(getInputSpy).not.toHaveBeenCalled(); | ||||
|       expect(getStateSpy).toHaveBeenCalledTimes(4); | ||||
|       expect(getCommandOutputSpy).toHaveBeenCalledTimes(0); | ||||
|       expect(debugSpy).toHaveBeenCalledTimes(0); | ||||
|       expect(infoSpy).toHaveBeenCalledWith( | ||||
| @@ -152,7 +159,9 @@ describe('run', () => { | ||||
|     it('should not save cache for npm', async () => { | ||||
|       inputs['cache'] = 'npm'; | ||||
|       getStateSpy.mockImplementation(key => | ||||
|         key === State.CachePrimaryKey || key === State.CacheMatchedKey | ||||
|         key === State.CachePackageManager | ||||
|           ? inputs['cache'] | ||||
|           : key === State.CachePrimaryKey || key === State.CacheMatchedKey | ||||
|           ? yarnFileHash | ||||
|           : key === State.CachePaths | ||||
|           ? '["/foo/bar"]' | ||||
| @@ -162,8 +171,8 @@ describe('run', () => { | ||||
|  | ||||
|       await run(); | ||||
|  | ||||
|       expect(getInputSpy).toHaveBeenCalled(); | ||||
|       expect(getStateSpy).toHaveBeenCalledTimes(3); | ||||
|       expect(getInputSpy).not.toHaveBeenCalled(); | ||||
|       expect(getStateSpy).toHaveBeenCalledTimes(4); | ||||
|       expect(getCommandOutputSpy).toHaveBeenCalledTimes(0); | ||||
|       expect(debugSpy).toHaveBeenCalledTimes(0); | ||||
|       expect(setFailedSpy).not.toHaveBeenCalled(); | ||||
| @@ -172,7 +181,9 @@ describe('run', () => { | ||||
|     it('should not save cache for pnpm', async () => { | ||||
|       inputs['cache'] = 'pnpm'; | ||||
|       getStateSpy.mockImplementation(key => | ||||
|         key === State.CachePrimaryKey || key === State.CacheMatchedKey | ||||
|         key === State.CachePackageManager | ||||
|           ? inputs['cache'] | ||||
|           : key === State.CachePrimaryKey || key === State.CacheMatchedKey | ||||
|           ? yarnFileHash | ||||
|           : key === State.CachePaths | ||||
|           ? '["/foo/bar"]' | ||||
| @@ -181,8 +192,8 @@ describe('run', () => { | ||||
|  | ||||
|       await run(); | ||||
|  | ||||
|       expect(getInputSpy).toHaveBeenCalled(); | ||||
|       expect(getStateSpy).toHaveBeenCalledTimes(3); | ||||
|       expect(getInputSpy).not.toHaveBeenCalled(); | ||||
|       expect(getStateSpy).toHaveBeenCalledTimes(4); | ||||
|       expect(getCommandOutputSpy).toHaveBeenCalledTimes(0); | ||||
|       expect(debugSpy).toHaveBeenCalledTimes(0); | ||||
|       expect(setFailedSpy).not.toHaveBeenCalled(); | ||||
| @@ -193,7 +204,9 @@ describe('run', () => { | ||||
|     it('saves cache from yarn 1', async () => { | ||||
|       inputs['cache'] = 'yarn'; | ||||
|       getStateSpy.mockImplementation((key: string) => | ||||
|         key === State.CacheMatchedKey | ||||
|         key === State.CachePackageManager | ||||
|           ? inputs['cache'] | ||||
|           : key === State.CacheMatchedKey | ||||
|           ? yarnFileHash | ||||
|           : key === State.CachePrimaryKey | ||||
|           ? npmFileHash | ||||
| @@ -204,8 +217,8 @@ describe('run', () => { | ||||
|  | ||||
|       await run(); | ||||
|  | ||||
|       expect(getInputSpy).toHaveBeenCalled(); | ||||
|       expect(getStateSpy).toHaveBeenCalledTimes(3); | ||||
|       expect(getInputSpy).not.toHaveBeenCalled(); | ||||
|       expect(getStateSpy).toHaveBeenCalledTimes(4); | ||||
|       expect(getCommandOutputSpy).toHaveBeenCalledTimes(0); | ||||
|       expect(debugSpy).toHaveBeenCalledTimes(0); | ||||
|       expect(infoSpy).not.toHaveBeenCalledWith( | ||||
| @@ -221,7 +234,9 @@ describe('run', () => { | ||||
|     it('saves cache from yarn 2', async () => { | ||||
|       inputs['cache'] = 'yarn'; | ||||
|       getStateSpy.mockImplementation((key: string) => | ||||
|         key === State.CacheMatchedKey | ||||
|         key === State.CachePackageManager | ||||
|           ? inputs['cache'] | ||||
|           : key === State.CacheMatchedKey | ||||
|           ? yarnFileHash | ||||
|           : key === State.CachePrimaryKey | ||||
|           ? npmFileHash | ||||
| @@ -232,8 +247,8 @@ describe('run', () => { | ||||
|  | ||||
|       await run(); | ||||
|  | ||||
|       expect(getInputSpy).toHaveBeenCalled(); | ||||
|       expect(getStateSpy).toHaveBeenCalledTimes(3); | ||||
|       expect(getInputSpy).not.toHaveBeenCalled(); | ||||
|       expect(getStateSpy).toHaveBeenCalledTimes(4); | ||||
|       expect(getCommandOutputSpy).toHaveBeenCalledTimes(0); | ||||
|       expect(debugSpy).toHaveBeenCalledTimes(0); | ||||
|       expect(infoSpy).not.toHaveBeenCalledWith( | ||||
| @@ -249,7 +264,9 @@ describe('run', () => { | ||||
|     it('saves cache from npm', async () => { | ||||
|       inputs['cache'] = 'npm'; | ||||
|       getStateSpy.mockImplementation((key: string) => | ||||
|         key === State.CacheMatchedKey | ||||
|         key === State.CachePackageManager | ||||
|           ? inputs['cache'] | ||||
|           : key === State.CacheMatchedKey | ||||
|           ? npmFileHash | ||||
|           : key === State.CachePrimaryKey | ||||
|           ? yarnFileHash | ||||
| @@ -260,8 +277,8 @@ describe('run', () => { | ||||
|  | ||||
|       await run(); | ||||
|  | ||||
|       expect(getInputSpy).toHaveBeenCalled(); | ||||
|       expect(getStateSpy).toHaveBeenCalledTimes(3); | ||||
|       expect(getInputSpy).not.toHaveBeenCalled(); | ||||
|       expect(getStateSpy).toHaveBeenCalledTimes(4); | ||||
|       expect(getCommandOutputSpy).toHaveBeenCalledTimes(0); | ||||
|       expect(debugSpy).toHaveBeenCalledTimes(0); | ||||
|       expect(infoSpy).not.toHaveBeenCalledWith( | ||||
| @@ -277,7 +294,9 @@ describe('run', () => { | ||||
|     it('saves cache from pnpm', async () => { | ||||
|       inputs['cache'] = 'pnpm'; | ||||
|       getStateSpy.mockImplementation((key: string) => | ||||
|         key === State.CacheMatchedKey | ||||
|         key === State.CachePackageManager | ||||
|           ? inputs['cache'] | ||||
|           : key === State.CacheMatchedKey | ||||
|           ? pnpmFileHash | ||||
|           : key === State.CachePrimaryKey | ||||
|           ? npmFileHash | ||||
| @@ -288,8 +307,8 @@ describe('run', () => { | ||||
|  | ||||
|       await run(); | ||||
|  | ||||
|       expect(getInputSpy).toHaveBeenCalled(); | ||||
|       expect(getStateSpy).toHaveBeenCalledTimes(3); | ||||
|       expect(getInputSpy).not.toHaveBeenCalled(); | ||||
|       expect(getStateSpy).toHaveBeenCalledTimes(4); | ||||
|       expect(getCommandOutputSpy).toHaveBeenCalledTimes(0); | ||||
|       expect(debugSpy).toHaveBeenCalledTimes(0); | ||||
|       expect(infoSpy).not.toHaveBeenCalledWith( | ||||
| @@ -305,7 +324,9 @@ describe('run', () => { | ||||
|     it('save with -1 cacheId , should not fail workflow', async () => { | ||||
|       inputs['cache'] = 'npm'; | ||||
|       getStateSpy.mockImplementation((key: string) => | ||||
|         key === State.CacheMatchedKey | ||||
|         key === State.CachePackageManager | ||||
|           ? inputs['cache'] | ||||
|           : key === State.CacheMatchedKey | ||||
|           ? npmFileHash | ||||
|           : key === State.CachePrimaryKey | ||||
|           ? yarnFileHash | ||||
| @@ -319,8 +340,8 @@ describe('run', () => { | ||||
|  | ||||
|       await run(); | ||||
|  | ||||
|       expect(getInputSpy).toHaveBeenCalled(); | ||||
|       expect(getStateSpy).toHaveBeenCalledTimes(3); | ||||
|       expect(getInputSpy).not.toHaveBeenCalled(); | ||||
|       expect(getStateSpy).toHaveBeenCalledTimes(4); | ||||
|       expect(getCommandOutputSpy).toHaveBeenCalledTimes(0); | ||||
|       expect(debugSpy).toHaveBeenCalledTimes(0); | ||||
|       expect(infoSpy).not.toHaveBeenCalledWith( | ||||
| @@ -336,7 +357,9 @@ describe('run', () => { | ||||
|     it('saves with error from toolkit, should fail workflow', async () => { | ||||
|       inputs['cache'] = 'npm'; | ||||
|       getStateSpy.mockImplementation((key: string) => | ||||
|         key === State.CacheMatchedKey | ||||
|         key === State.CachePackageManager | ||||
|           ? inputs['cache'] | ||||
|           : key === State.CacheMatchedKey | ||||
|           ? npmFileHash | ||||
|           : key === State.CachePrimaryKey | ||||
|           ? yarnFileHash | ||||
| @@ -350,8 +373,8 @@ describe('run', () => { | ||||
|  | ||||
|       await run(); | ||||
|  | ||||
|       expect(getInputSpy).toHaveBeenCalled(); | ||||
|       expect(getStateSpy).toHaveBeenCalledTimes(3); | ||||
|       expect(getInputSpy).not.toHaveBeenCalled(); | ||||
|       expect(getStateSpy).toHaveBeenCalledTimes(4); | ||||
|       expect(getCommandOutputSpy).toHaveBeenCalledTimes(0); | ||||
|       expect(debugSpy).toHaveBeenCalledTimes(0); | ||||
|       expect(infoSpy).not.toHaveBeenCalledWith( | ||||
|   | ||||
| @@ -23,8 +23,10 @@ describe('cache-utils', () => { | ||||
|   let isFeatureAvailable: jest.SpyInstance; | ||||
|   let info: jest.SpyInstance; | ||||
|   let warningSpy: jest.SpyInstance; | ||||
|   let fsRealPathSyncSpy: jest.SpyInstance; | ||||
|  | ||||
|   beforeEach(() => { | ||||
|     console.log('::stop-commands::stoptoken'); | ||||
|     process.env['GITHUB_WORKSPACE'] = path.join(__dirname, 'data'); | ||||
|     debugSpy = jest.spyOn(core, 'debug'); | ||||
|     debugSpy.mockImplementation(msg => {}); | ||||
| @@ -35,7 +37,23 @@ describe('cache-utils', () => { | ||||
|     isFeatureAvailable = jest.spyOn(cache, 'isFeatureAvailable'); | ||||
|  | ||||
|     getCommandOutputSpy = jest.spyOn(utils, 'getCommandOutput'); | ||||
|  | ||||
|     fsRealPathSyncSpy = jest.spyOn(fs, 'realpathSync'); | ||||
|     fsRealPathSyncSpy.mockImplementation(dirName => { | ||||
|       return dirName; | ||||
|     }); | ||||
|   }); | ||||
|  | ||||
|   afterEach(() => { | ||||
|     jest.resetAllMocks(); | ||||
|     jest.clearAllMocks(); | ||||
|     //jest.restoreAllMocks(); | ||||
|   }); | ||||
|  | ||||
|   afterAll(async () => { | ||||
|     console.log('::stoptoken::'); | ||||
|     jest.restoreAllMocks(); | ||||
|   }, 100000); | ||||
|  | ||||
|   describe('getPackageManagerInfo', () => { | ||||
|     it.each<[string, PackageManagerInfo | null]>([ | ||||
|   | ||||
							
								
								
									
										1
									
								
								__tests__/data/.tool-versions-node
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								__tests__/data/.tool-versions-node
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1 @@ | ||||
| node 14.0.0 | ||||
| @@ -95,6 +95,8 @@ describe('setup-node', () => { | ||||
|         res = <INodeVersion[]>nodeTestDistRc; | ||||
|       } else if (url.includes('/nightly')) { | ||||
|         res = <INodeVersion[]>nodeTestDistNightly; | ||||
|       } else if (url.includes('/v8-canary')) { | ||||
|         res = <INodeVersion[]>nodeV8CanaryTestDist; | ||||
|       } else { | ||||
|         res = <INodeVersion[]>nodeTestDist; | ||||
|       } | ||||
|   | ||||
							
								
								
									
										1372
									
								
								dist/cache-save/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1372
									
								
								dist/cache-save/index.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										1365
									
								
								dist/setup/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1365
									
								
								dist/setup/index.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										251
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										251
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							| @@ -17,7 +17,7 @@ | ||||
|         "@actions/http-client": "^1.0.11", | ||||
|         "@actions/io": "^1.0.2", | ||||
|         "@actions/tool-cache": "^1.5.4", | ||||
|         "semver": "^6.1.1" | ||||
|         "semver": "^6.3.1" | ||||
|       }, | ||||
|       "devDependencies": { | ||||
|         "@types/jest": "^27.0.2", | ||||
| @@ -39,17 +39,18 @@ | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/@actions/cache": { | ||||
|       "version": "3.0.4", | ||||
|       "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.0.4.tgz", | ||||
|       "integrity": "sha512-9RwVL8/ISJoYWFNH1wR/C26E+M3HDkGPWmbFJMMCKwTkjbNZJreMT4XaR/EB1bheIvN4PREQxEQQVJ18IPnf/Q==", | ||||
|       "version": "3.2.1", | ||||
|       "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.2.1.tgz", | ||||
|       "integrity": "sha512-QurbMiY//02+0kN1adJkMHN44RcZ5kAXfhSnKUZmtSmhMTNqLitGArG1xOkt93NNyByTlLGAc5wIOF/dZ2ENOQ==", | ||||
|       "dependencies": { | ||||
|         "@actions/core": "^1.2.6", | ||||
|         "@actions/core": "^1.10.0", | ||||
|         "@actions/exec": "^1.0.1", | ||||
|         "@actions/glob": "^0.1.0", | ||||
|         "@actions/http-client": "^2.0.1", | ||||
|         "@actions/io": "^1.0.1", | ||||
|         "@azure/abort-controller": "^1.1.0", | ||||
|         "@azure/ms-rest-js": "^2.6.0", | ||||
|         "@azure/storage-blob": "^12.8.0", | ||||
|         "@azure/storage-blob": "^12.13.0", | ||||
|         "semver": "^6.1.0", | ||||
|         "uuid": "^3.3.3" | ||||
|       } | ||||
| @@ -158,14 +159,14 @@ | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/@azure/abort-controller": { | ||||
|       "version": "1.0.4", | ||||
|       "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-1.0.4.tgz", | ||||
|       "integrity": "sha512-lNUmDRVGpanCsiUN3NWxFTdwmdFI53xwhkTFfHDGTYk46ca7Ind3nanJc+U6Zj9Tv+9nTCWRBscWEW1DyKOpTw==", | ||||
|       "version": "1.1.0", | ||||
|       "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-1.1.0.tgz", | ||||
|       "integrity": "sha512-TrRLIoSQVzfAJX9H1JeFjzAoDGcoK1IYX1UImfceTZpsyYfWr09Ss1aHW1y5TrrR3iq6RZLBwJ3E24uwPhwahw==", | ||||
|       "dependencies": { | ||||
|         "tslib": "^2.0.0" | ||||
|         "tslib": "^2.2.0" | ||||
|       }, | ||||
|       "engines": { | ||||
|         "node": ">=8.0.0" | ||||
|         "node": ">=12.0.0" | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/@azure/abort-controller/node_modules/tslib": { | ||||
| @@ -335,15 +336,14 @@ | ||||
|       "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" | ||||
|     }, | ||||
|     "node_modules/@azure/ms-rest-js": { | ||||
|       "version": "2.6.6", | ||||
|       "resolved": "https://registry.npmjs.org/@azure/ms-rest-js/-/ms-rest-js-2.6.6.tgz", | ||||
|       "integrity": "sha512-WYIda8VvrkZE68xHgOxUXvjThxNf1nnGPPe0rAljqK5HJHIZ12Pi3YhEDOn3Ge7UnwaaM3eFO0VtAy4nGVI27Q==", | ||||
|       "version": "2.7.0", | ||||
|       "resolved": "https://registry.npmjs.org/@azure/ms-rest-js/-/ms-rest-js-2.7.0.tgz", | ||||
|       "integrity": "sha512-ngbzWbqF+NmztDOpLBVDxYM+XLcUj7nKhxGbSU9WtIsXfRB//cf2ZbAG5HkOrhU9/wd/ORRB6lM/d69RKVjiyA==", | ||||
|       "dependencies": { | ||||
|         "@azure/core-auth": "^1.1.4", | ||||
|         "abort-controller": "^3.0.0", | ||||
|         "form-data": "^2.5.0", | ||||
|         "node-fetch": "^2.6.7", | ||||
|         "tough-cookie": "^3.0.1", | ||||
|         "tslib": "^1.10.0", | ||||
|         "tunnel": "0.0.6", | ||||
|         "uuid": "^8.3.2", | ||||
| @@ -363,19 +363,6 @@ | ||||
|         "node": ">= 0.12" | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/@azure/ms-rest-js/node_modules/tough-cookie": { | ||||
|       "version": "3.0.1", | ||||
|       "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-3.0.1.tgz", | ||||
|       "integrity": "sha512-yQyJ0u4pZsv9D4clxO69OEjLWYw+jbgspjTue4lTQZLfV0c5l1VmK2y1JK8E9ahdpltPOaAThPcp5nKPUgSnsg==", | ||||
|       "dependencies": { | ||||
|         "ip-regex": "^2.1.0", | ||||
|         "psl": "^1.1.28", | ||||
|         "punycode": "^2.1.1" | ||||
|       }, | ||||
|       "engines": { | ||||
|         "node": ">=6" | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/@azure/ms-rest-js/node_modules/uuid": { | ||||
|       "version": "8.3.2", | ||||
|       "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", | ||||
| @@ -458,15 +445,6 @@ | ||||
|         "url": "https://opencollective.com/babel" | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/@babel/core/node_modules/semver": { | ||||
|       "version": "6.3.0", | ||||
|       "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", | ||||
|       "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", | ||||
|       "dev": true, | ||||
|       "bin": { | ||||
|         "semver": "bin/semver.js" | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/@babel/core/node_modules/source-map": { | ||||
|       "version": "0.5.7", | ||||
|       "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", | ||||
| @@ -517,15 +495,6 @@ | ||||
|         "@babel/core": "^7.0.0" | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/@babel/helper-compilation-targets/node_modules/semver": { | ||||
|       "version": "6.3.0", | ||||
|       "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", | ||||
|       "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", | ||||
|       "dev": true, | ||||
|       "bin": { | ||||
|         "semver": "bin/semver.js" | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/@babel/helper-function-name": { | ||||
|       "version": "7.15.4", | ||||
|       "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.15.4.tgz", | ||||
| @@ -3785,14 +3754,6 @@ | ||||
|       "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", | ||||
|       "dev": true | ||||
|     }, | ||||
|     "node_modules/ip-regex": { | ||||
|       "version": "2.1.0", | ||||
|       "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz", | ||||
|       "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=", | ||||
|       "engines": { | ||||
|         "node": ">=4" | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/is-ci": { | ||||
|       "version": "3.0.0", | ||||
|       "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-3.0.0.tgz", | ||||
| @@ -3923,15 +3884,6 @@ | ||||
|         "node": ">=8" | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/istanbul-lib-instrument/node_modules/semver": { | ||||
|       "version": "6.3.0", | ||||
|       "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", | ||||
|       "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", | ||||
|       "dev": true, | ||||
|       "bin": { | ||||
|         "semver": "bin/semver.js" | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/istanbul-lib-report": { | ||||
|       "version": "3.0.0", | ||||
|       "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", | ||||
| @@ -5538,7 +5490,8 @@ | ||||
|     "node_modules/psl": { | ||||
|       "version": "1.8.0", | ||||
|       "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", | ||||
|       "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" | ||||
|       "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", | ||||
|       "dev": true | ||||
|     }, | ||||
|     "node_modules/pump": { | ||||
|       "version": "3.0.0", | ||||
| @@ -5553,10 +5506,17 @@ | ||||
|       "version": "2.1.1", | ||||
|       "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", | ||||
|       "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", | ||||
|       "dev": true, | ||||
|       "engines": { | ||||
|         "node": ">=6" | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/querystringify": { | ||||
|       "version": "2.2.0", | ||||
|       "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", | ||||
|       "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", | ||||
|       "dev": true | ||||
|     }, | ||||
|     "node_modules/queue-microtask": { | ||||
|       "version": "1.2.3", | ||||
|       "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", | ||||
| @@ -5604,6 +5564,12 @@ | ||||
|         "node": ">=0.10.0" | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/requires-port": { | ||||
|       "version": "1.0.0", | ||||
|       "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", | ||||
|       "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", | ||||
|       "dev": true | ||||
|     }, | ||||
|     "node_modules/resolve": { | ||||
|       "version": "1.22.2", | ||||
|       "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", | ||||
| @@ -5720,11 +5686,11 @@ | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/semver": { | ||||
|       "version": "6.1.2", | ||||
|       "resolved": "https://registry.npmjs.org/semver/-/semver-6.1.2.tgz", | ||||
|       "integrity": "sha512-z4PqiCpomGtWj8633oeAdXm1Kn1W++3T8epkZYnwiVgIYIJ0QHszhInYSJTYxebByQH7KVCEAn8R9duzZW2PhQ==", | ||||
|       "version": "6.3.1", | ||||
|       "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", | ||||
|       "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", | ||||
|       "bin": { | ||||
|         "semver": "bin/semver" | ||||
|         "semver": "bin/semver.js" | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/shebang-command": { | ||||
| @@ -6002,14 +5968,15 @@ | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/tough-cookie": { | ||||
|       "version": "4.0.0", | ||||
|       "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz", | ||||
|       "integrity": "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==", | ||||
|       "version": "4.1.3", | ||||
|       "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", | ||||
|       "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", | ||||
|       "dev": true, | ||||
|       "dependencies": { | ||||
|         "psl": "^1.1.33", | ||||
|         "punycode": "^2.1.1", | ||||
|         "universalify": "^0.1.2" | ||||
|         "universalify": "^0.2.0", | ||||
|         "url-parse": "^1.5.3" | ||||
|       }, | ||||
|       "engines": { | ||||
|         "node": ">=6" | ||||
| @@ -6174,9 +6141,9 @@ | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/universalify": { | ||||
|       "version": "0.1.2", | ||||
|       "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", | ||||
|       "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", | ||||
|       "version": "0.2.0", | ||||
|       "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", | ||||
|       "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", | ||||
|       "dev": true, | ||||
|       "engines": { | ||||
|         "node": ">= 4.0.0" | ||||
| @@ -6191,6 +6158,16 @@ | ||||
|         "punycode": "^2.1.0" | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/url-parse": { | ||||
|       "version": "1.5.10", | ||||
|       "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", | ||||
|       "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", | ||||
|       "dev": true, | ||||
|       "dependencies": { | ||||
|         "querystringify": "^2.1.1", | ||||
|         "requires-port": "^1.0.0" | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/uuid": { | ||||
|       "version": "3.3.2", | ||||
|       "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", | ||||
| @@ -6314,9 +6291,9 @@ | ||||
|       } | ||||
|     }, | ||||
|     "node_modules/word-wrap": { | ||||
|       "version": "1.2.3", | ||||
|       "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", | ||||
|       "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", | ||||
|       "version": "1.2.4", | ||||
|       "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz", | ||||
|       "integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==", | ||||
|       "dev": true, | ||||
|       "engines": { | ||||
|         "node": ">=0.10.0" | ||||
| @@ -6466,17 +6443,18 @@ | ||||
|   }, | ||||
|   "dependencies": { | ||||
|     "@actions/cache": { | ||||
|       "version": "3.0.4", | ||||
|       "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.0.4.tgz", | ||||
|       "integrity": "sha512-9RwVL8/ISJoYWFNH1wR/C26E+M3HDkGPWmbFJMMCKwTkjbNZJreMT4XaR/EB1bheIvN4PREQxEQQVJ18IPnf/Q==", | ||||
|       "version": "3.2.1", | ||||
|       "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.2.1.tgz", | ||||
|       "integrity": "sha512-QurbMiY//02+0kN1adJkMHN44RcZ5kAXfhSnKUZmtSmhMTNqLitGArG1xOkt93NNyByTlLGAc5wIOF/dZ2ENOQ==", | ||||
|       "requires": { | ||||
|         "@actions/core": "^1.2.6", | ||||
|         "@actions/core": "^1.10.0", | ||||
|         "@actions/exec": "^1.0.1", | ||||
|         "@actions/glob": "^0.1.0", | ||||
|         "@actions/http-client": "^2.0.1", | ||||
|         "@actions/io": "^1.0.1", | ||||
|         "@azure/abort-controller": "^1.1.0", | ||||
|         "@azure/ms-rest-js": "^2.6.0", | ||||
|         "@azure/storage-blob": "^12.8.0", | ||||
|         "@azure/storage-blob": "^12.13.0", | ||||
|         "semver": "^6.1.0", | ||||
|         "uuid": "^3.3.3" | ||||
|       }, | ||||
| @@ -6582,11 +6560,11 @@ | ||||
|       } | ||||
|     }, | ||||
|     "@azure/abort-controller": { | ||||
|       "version": "1.0.4", | ||||
|       "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-1.0.4.tgz", | ||||
|       "integrity": "sha512-lNUmDRVGpanCsiUN3NWxFTdwmdFI53xwhkTFfHDGTYk46ca7Ind3nanJc+U6Zj9Tv+9nTCWRBscWEW1DyKOpTw==", | ||||
|       "version": "1.1.0", | ||||
|       "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-1.1.0.tgz", | ||||
|       "integrity": "sha512-TrRLIoSQVzfAJX9H1JeFjzAoDGcoK1IYX1UImfceTZpsyYfWr09Ss1aHW1y5TrrR3iq6RZLBwJ3E24uwPhwahw==", | ||||
|       "requires": { | ||||
|         "tslib": "^2.0.0" | ||||
|         "tslib": "^2.2.0" | ||||
|       }, | ||||
|       "dependencies": { | ||||
|         "tslib": { | ||||
| @@ -6742,15 +6720,14 @@ | ||||
|       } | ||||
|     }, | ||||
|     "@azure/ms-rest-js": { | ||||
|       "version": "2.6.6", | ||||
|       "resolved": "https://registry.npmjs.org/@azure/ms-rest-js/-/ms-rest-js-2.6.6.tgz", | ||||
|       "integrity": "sha512-WYIda8VvrkZE68xHgOxUXvjThxNf1nnGPPe0rAljqK5HJHIZ12Pi3YhEDOn3Ge7UnwaaM3eFO0VtAy4nGVI27Q==", | ||||
|       "version": "2.7.0", | ||||
|       "resolved": "https://registry.npmjs.org/@azure/ms-rest-js/-/ms-rest-js-2.7.0.tgz", | ||||
|       "integrity": "sha512-ngbzWbqF+NmztDOpLBVDxYM+XLcUj7nKhxGbSU9WtIsXfRB//cf2ZbAG5HkOrhU9/wd/ORRB6lM/d69RKVjiyA==", | ||||
|       "requires": { | ||||
|         "@azure/core-auth": "^1.1.4", | ||||
|         "abort-controller": "^3.0.0", | ||||
|         "form-data": "^2.5.0", | ||||
|         "node-fetch": "^2.6.7", | ||||
|         "tough-cookie": "^3.0.1", | ||||
|         "tslib": "^1.10.0", | ||||
|         "tunnel": "0.0.6", | ||||
|         "uuid": "^8.3.2", | ||||
| @@ -6767,16 +6744,6 @@ | ||||
|             "mime-types": "^2.1.12" | ||||
|           } | ||||
|         }, | ||||
|         "tough-cookie": { | ||||
|           "version": "3.0.1", | ||||
|           "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-3.0.1.tgz", | ||||
|           "integrity": "sha512-yQyJ0u4pZsv9D4clxO69OEjLWYw+jbgspjTue4lTQZLfV0c5l1VmK2y1JK8E9ahdpltPOaAThPcp5nKPUgSnsg==", | ||||
|           "requires": { | ||||
|             "ip-regex": "^2.1.0", | ||||
|             "psl": "^1.1.28", | ||||
|             "punycode": "^2.1.1" | ||||
|           } | ||||
|         }, | ||||
|         "uuid": { | ||||
|           "version": "8.3.2", | ||||
|           "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", | ||||
| @@ -6844,12 +6811,6 @@ | ||||
|         "source-map": "^0.5.0" | ||||
|       }, | ||||
|       "dependencies": { | ||||
|         "semver": { | ||||
|           "version": "6.3.0", | ||||
|           "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", | ||||
|           "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", | ||||
|           "dev": true | ||||
|         }, | ||||
|         "source-map": { | ||||
|           "version": "0.5.7", | ||||
|           "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", | ||||
| @@ -6887,14 +6848,6 @@ | ||||
|         "@babel/helper-validator-option": "^7.14.5", | ||||
|         "browserslist": "^4.16.6", | ||||
|         "semver": "^6.3.0" | ||||
|       }, | ||||
|       "dependencies": { | ||||
|         "semver": { | ||||
|           "version": "6.3.0", | ||||
|           "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", | ||||
|           "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", | ||||
|           "dev": true | ||||
|         } | ||||
|       } | ||||
|     }, | ||||
|     "@babel/helper-function-name": { | ||||
| @@ -9367,11 +9320,6 @@ | ||||
|       "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", | ||||
|       "dev": true | ||||
|     }, | ||||
|     "ip-regex": { | ||||
|       "version": "2.1.0", | ||||
|       "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz", | ||||
|       "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=" | ||||
|     }, | ||||
|     "is-ci": { | ||||
|       "version": "3.0.0", | ||||
|       "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-3.0.0.tgz", | ||||
| @@ -9467,14 +9415,6 @@ | ||||
|         "@istanbuljs/schema": "^0.1.2", | ||||
|         "istanbul-lib-coverage": "^3.0.0", | ||||
|         "semver": "^6.3.0" | ||||
|       }, | ||||
|       "dependencies": { | ||||
|         "semver": { | ||||
|           "version": "6.3.0", | ||||
|           "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", | ||||
|           "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", | ||||
|           "dev": true | ||||
|         } | ||||
|       } | ||||
|     }, | ||||
|     "istanbul-lib-report": { | ||||
| @@ -10695,7 +10635,8 @@ | ||||
|     "psl": { | ||||
|       "version": "1.8.0", | ||||
|       "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", | ||||
|       "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==" | ||||
|       "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", | ||||
|       "dev": true | ||||
|     }, | ||||
|     "pump": { | ||||
|       "version": "3.0.0", | ||||
| @@ -10709,7 +10650,14 @@ | ||||
|     "punycode": { | ||||
|       "version": "2.1.1", | ||||
|       "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", | ||||
|       "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" | ||||
|       "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", | ||||
|       "dev": true | ||||
|     }, | ||||
|     "querystringify": { | ||||
|       "version": "2.2.0", | ||||
|       "resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz", | ||||
|       "integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==", | ||||
|       "dev": true | ||||
|     }, | ||||
|     "queue-microtask": { | ||||
|       "version": "1.2.3", | ||||
| @@ -10735,6 +10683,12 @@ | ||||
|       "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", | ||||
|       "dev": true | ||||
|     }, | ||||
|     "requires-port": { | ||||
|       "version": "1.0.0", | ||||
|       "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", | ||||
|       "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", | ||||
|       "dev": true | ||||
|     }, | ||||
|     "resolve": { | ||||
|       "version": "1.22.2", | ||||
|       "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.2.tgz", | ||||
| @@ -10812,9 +10766,9 @@ | ||||
|       } | ||||
|     }, | ||||
|     "semver": { | ||||
|       "version": "6.1.2", | ||||
|       "resolved": "https://registry.npmjs.org/semver/-/semver-6.1.2.tgz", | ||||
|       "integrity": "sha512-z4PqiCpomGtWj8633oeAdXm1Kn1W++3T8epkZYnwiVgIYIJ0QHszhInYSJTYxebByQH7KVCEAn8R9duzZW2PhQ==" | ||||
|       "version": "6.3.1", | ||||
|       "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", | ||||
|       "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==" | ||||
|     }, | ||||
|     "shebang-command": { | ||||
|       "version": "1.2.0", | ||||
| @@ -11024,14 +10978,15 @@ | ||||
|       } | ||||
|     }, | ||||
|     "tough-cookie": { | ||||
|       "version": "4.0.0", | ||||
|       "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz", | ||||
|       "integrity": "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==", | ||||
|       "version": "4.1.3", | ||||
|       "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz", | ||||
|       "integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==", | ||||
|       "dev": true, | ||||
|       "requires": { | ||||
|         "psl": "^1.1.33", | ||||
|         "punycode": "^2.1.1", | ||||
|         "universalify": "^0.1.2" | ||||
|         "universalify": "^0.2.0", | ||||
|         "url-parse": "^1.5.3" | ||||
|       } | ||||
|     }, | ||||
|     "tr46": { | ||||
| @@ -11134,9 +11089,9 @@ | ||||
|       } | ||||
|     }, | ||||
|     "universalify": { | ||||
|       "version": "0.1.2", | ||||
|       "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", | ||||
|       "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", | ||||
|       "version": "0.2.0", | ||||
|       "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz", | ||||
|       "integrity": "sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==", | ||||
|       "dev": true | ||||
|     }, | ||||
|     "uri-js": { | ||||
| @@ -11148,6 +11103,16 @@ | ||||
|         "punycode": "^2.1.0" | ||||
|       } | ||||
|     }, | ||||
|     "url-parse": { | ||||
|       "version": "1.5.10", | ||||
|       "resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz", | ||||
|       "integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==", | ||||
|       "dev": true, | ||||
|       "requires": { | ||||
|         "querystringify": "^2.1.1", | ||||
|         "requires-port": "^1.0.0" | ||||
|       } | ||||
|     }, | ||||
|     "uuid": { | ||||
|       "version": "3.3.2", | ||||
|       "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", | ||||
| @@ -11248,9 +11213,9 @@ | ||||
|       } | ||||
|     }, | ||||
|     "word-wrap": { | ||||
|       "version": "1.2.3", | ||||
|       "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", | ||||
|       "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", | ||||
|       "version": "1.2.4", | ||||
|       "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz", | ||||
|       "integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==", | ||||
|       "dev": true | ||||
|     }, | ||||
|     "wrap-ansi": { | ||||
|   | ||||
| @@ -33,7 +33,7 @@ | ||||
|     "@actions/http-client": "^1.0.11", | ||||
|     "@actions/io": "^1.0.2", | ||||
|     "@actions/tool-cache": "^1.5.4", | ||||
|     "semver": "^6.1.1" | ||||
|     "semver": "^6.3.1" | ||||
|   }, | ||||
|   "devDependencies": { | ||||
|     "@types/jest": "^27.0.2", | ||||
|   | ||||
| @@ -1,5 +1,8 @@ | ||||
| import * as core from '@actions/core'; | ||||
| import * as cache from '@actions/cache'; | ||||
|  | ||||
| import fs from 'fs'; | ||||
|  | ||||
| import {State} from './constants'; | ||||
| import {getPackageManagerInfo} from './cache-utils'; | ||||
|  | ||||
| @@ -13,7 +16,7 @@ process.on('uncaughtException', e => { | ||||
|  | ||||
| export async function run() { | ||||
|   try { | ||||
|     const cacheLock = core.getInput('cache'); | ||||
|     const cacheLock = core.getState(State.CachePackageManager); | ||||
|     await cachePackages(cacheLock); | ||||
|   } catch (error) { | ||||
|     core.setFailed(error.message); | ||||
| @@ -23,7 +26,10 @@ export async function run() { | ||||
| const cachePackages = async (packageManager: string) => { | ||||
|   const state = core.getState(State.CacheMatchedKey); | ||||
|   const primaryKey = core.getState(State.CachePrimaryKey); | ||||
|   const cachePaths = JSON.parse(core.getState(State.CachePaths) || '[]'); | ||||
|   let cachePaths = JSON.parse( | ||||
|     core.getState(State.CachePaths) || '[]' | ||||
|   ) as string[]; | ||||
|   cachePaths = cachePaths.filter(fs.existsSync); | ||||
|  | ||||
|   const packageManagerInfo = await getPackageManagerInfo(packageManager); | ||||
|   if (!packageManagerInfo) { | ||||
| @@ -31,7 +37,7 @@ const cachePackages = async (packageManager: string) => { | ||||
|     return; | ||||
|   } | ||||
|  | ||||
|   if (cachePaths.length === 0) { | ||||
|   if (!cachePaths.length) { | ||||
|     // TODO: core.getInput has a bug - it can return undefined despite its definition (tests only?) | ||||
|     //       export declare function getInput(name: string, options?: InputOptions): string; | ||||
|     const cacheDependencyPath = core.getInput('cache-dependency-path') || ''; | ||||
|   | ||||
| @@ -144,6 +144,7 @@ const getProjectDirectoriesFromCacheDependencyPath = async ( | ||||
|   const existingDirectories: string[] = cacheDependenciesPaths | ||||
|     .map(path.dirname) | ||||
|     .filter(unique()) | ||||
|     .map(dirName => fs.realpathSync(dirName)) | ||||
|     .filter(directory => fs.lstatSync(directory).isDirectory()); | ||||
|  | ||||
|   if (!existingDirectories.length) | ||||
|   | ||||
| @@ -5,6 +5,7 @@ export enum LockType { | ||||
| } | ||||
|  | ||||
| export enum State { | ||||
|   CachePackageManager = 'SETUP_NODE_CACHE_PACKAGE_MANAGER', | ||||
|   CachePrimaryKey = 'CACHE_KEY', | ||||
|   CacheMatchedKey = 'CACHE_RESULT', | ||||
|   CachePaths = 'CACHE_PATHS' | ||||
|   | ||||
| @@ -88,7 +88,11 @@ export default abstract class BaseDistribution { | ||||
|   } | ||||
|  | ||||
|   protected findVersionInHostedToolCacheDirectory() { | ||||
|     return tc.find('node', this.nodeInfo.versionSpec, this.nodeInfo.arch); | ||||
|     return tc.find( | ||||
|       'node', | ||||
|       this.nodeInfo.versionSpec, | ||||
|       this.translateArchToDistUrl(this.nodeInfo.arch) | ||||
|     ); | ||||
|   } | ||||
|  | ||||
|   protected async getNodeJsVersions(): Promise<INodeVersion[]> { | ||||
|   | ||||
| @@ -9,6 +9,7 @@ import {restoreCache} from './cache-restore'; | ||||
| import {isCacheFeatureAvailable} from './cache-utils'; | ||||
| import {getNodejsDistribution} from './distributions/installer-factory'; | ||||
| import {parseNodeVersionFile, printEnvDetailsAndSetOutput} from './util'; | ||||
| import {State} from './constants'; | ||||
|  | ||||
| export async function run() { | ||||
|   try { | ||||
| @@ -60,6 +61,7 @@ export async function run() { | ||||
|     } | ||||
|  | ||||
|     if (cache && isCacheFeatureAvailable()) { | ||||
|       core.saveState(State.CachePackageManager, cache); | ||||
|       const cacheDependencyPath = core.getInput('cache-dependency-path'); | ||||
|       await restoreCache(cache, cacheDependencyPath); | ||||
|     } | ||||
|   | ||||
| @@ -13,7 +13,7 @@ export function parseNodeVersionFile(contents: string): string { | ||||
|   } | ||||
|  | ||||
|   if (!nodeVersion) { | ||||
|     const found = contents.match(/^(?:nodejs\s+)?v?(?<version>[^\s]+)$/m); | ||||
|     const found = contents.match(/^(?:node(js)?\s+)?v?(?<version>[^\s]+)$/m); | ||||
|     nodeVersion = found?.groups?.version; | ||||
|   } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user