You've already forked setup-node
							
							
				mirror of
				https://github.com/actions/setup-node.git
				synced 2025-11-04 08:46:39 +07:00 
			
		
		
		
	Compare commits
	
		
			3 Commits
		
	
	
		
			update-mem
			...
			update-tem
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 809128768a | |||
| 2962d3dc11 | |||
| 7d88b53df7 | 
							
								
								
									
										58
									
								
								.licenses/npm/lodash.memoize.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										58
									
								
								.licenses/npm/lodash.memoize.dep.yml
									
									
									
										generated
									
									
									
								
							@ -1,58 +0,0 @@
 | 
			
		||||
---
 | 
			
		||||
name: lodash.memoize
 | 
			
		||||
version: 4.1.2
 | 
			
		||||
type: npm
 | 
			
		||||
summary: The lodash method `_.memoize` exported as a module.
 | 
			
		||||
homepage: https://lodash.com/
 | 
			
		||||
license: mit
 | 
			
		||||
licenses:
 | 
			
		||||
- sources: LICENSE
 | 
			
		||||
  text: |
 | 
			
		||||
    Copyright jQuery Foundation and other contributors <https://jquery.org/>
 | 
			
		||||
 | 
			
		||||
    Based on Underscore.js, copyright Jeremy Ashkenas,
 | 
			
		||||
    DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
 | 
			
		||||
 | 
			
		||||
    This software consists of voluntary contributions made by many
 | 
			
		||||
    individuals. For exact contribution history, see the revision history
 | 
			
		||||
    available at https://github.com/lodash/lodash
 | 
			
		||||
 | 
			
		||||
    The following license applies to all parts of this software except as
 | 
			
		||||
    documented below:
 | 
			
		||||
 | 
			
		||||
    ====
 | 
			
		||||
 | 
			
		||||
    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.
 | 
			
		||||
 | 
			
		||||
    ====
 | 
			
		||||
 | 
			
		||||
    Copyright and related rights for sample code are waived via CC0. Sample
 | 
			
		||||
    code is defined as all source code displayed within the prose of the
 | 
			
		||||
    documentation.
 | 
			
		||||
 | 
			
		||||
    CC0: http://creativecommons.org/publicdomain/zero/1.0/
 | 
			
		||||
 | 
			
		||||
    ====
 | 
			
		||||
 | 
			
		||||
    Files located in the node_modules and vendor directories are externally
 | 
			
		||||
    maintained libraries used by this software which have their own
 | 
			
		||||
    licenses; we recommend you read them, as their terms may differ from the
 | 
			
		||||
    terms above.
 | 
			
		||||
notices: []
 | 
			
		||||
							
								
								
									
										39
									
								
								.licenses/npm/uuid-3.3.2.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										39
									
								
								.licenses/npm/uuid-3.3.2.dep.yml
									
									
									
										generated
									
									
									
								
							@ -1,39 +0,0 @@
 | 
			
		||||
---
 | 
			
		||||
name: uuid
 | 
			
		||||
version: 3.3.2
 | 
			
		||||
type: npm
 | 
			
		||||
summary: RFC4122 (v1, v4, and v5) UUIDs
 | 
			
		||||
homepage: https://github.com/kelektiv/node-uuid#readme
 | 
			
		||||
license: mit
 | 
			
		||||
licenses:
 | 
			
		||||
- sources: LICENSE.md
 | 
			
		||||
  text: |
 | 
			
		||||
    The MIT License (MIT)
 | 
			
		||||
 | 
			
		||||
    Copyright (c) 2010-2016 Robert Kieffer and other contributors
 | 
			
		||||
 | 
			
		||||
    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:
 | 
			
		||||
- sources: AUTHORS
 | 
			
		||||
  text: |-
 | 
			
		||||
    Robert Kieffer <robert@broofa.com>
 | 
			
		||||
    Christoph Tavan <dev@tavan.de>
 | 
			
		||||
    AJ ONeal <coolaj86@gmail.com>
 | 
			
		||||
    Vincent Voyer <vincent@zeroload.net>
 | 
			
		||||
    Roman Shtylman <shtylman@gmail.com>
 | 
			
		||||
							
								
								
									
										20
									
								
								.licenses/npm/uuid-9.0.0.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								.licenses/npm/uuid-9.0.0.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							@ -0,0 +1,20 @@
 | 
			
		||||
---
 | 
			
		||||
name: uuid
 | 
			
		||||
version: 9.0.0
 | 
			
		||||
type: npm
 | 
			
		||||
summary: RFC4122 (v1, v4, and v5) UUIDs
 | 
			
		||||
homepage: 
 | 
			
		||||
license: mit
 | 
			
		||||
licenses:
 | 
			
		||||
- sources: LICENSE.md
 | 
			
		||||
  text: |
 | 
			
		||||
    The MIT License (MIT)
 | 
			
		||||
 | 
			
		||||
    Copyright (c) 2010-2020 Robert Kieffer and other contributors
 | 
			
		||||
 | 
			
		||||
    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: []
 | 
			
		||||
@ -92,9 +92,6 @@ describe('run', () => {
 | 
			
		||||
 | 
			
		||||
    it('Package manager is not valid, skip caching', async () => {
 | 
			
		||||
      inputs['cache'] = 'yarn3';
 | 
			
		||||
      getStateSpy.mockImplementation(key =>
 | 
			
		||||
        key === State.CachePackageManager ? inputs['cache'] : ''
 | 
			
		||||
      );
 | 
			
		||||
 | 
			
		||||
      await run();
 | 
			
		||||
 | 
			
		||||
@ -111,9 +108,7 @@ describe('run', () => {
 | 
			
		||||
    it('should not save cache for yarn1', async () => {
 | 
			
		||||
      inputs['cache'] = 'yarn';
 | 
			
		||||
      getStateSpy.mockImplementation(key =>
 | 
			
		||||
        key === State.CachePackageManager
 | 
			
		||||
          ? inputs['cache']
 | 
			
		||||
          : key === State.CachePrimaryKey || key === State.CacheMatchedKey
 | 
			
		||||
        key === State.CachePrimaryKey || key === State.CacheMatchedKey
 | 
			
		||||
          ? yarnFileHash
 | 
			
		||||
          : key === State.CachePaths
 | 
			
		||||
          ? '["/foo/bar"]'
 | 
			
		||||
@ -122,8 +117,8 @@ describe('run', () => {
 | 
			
		||||
 | 
			
		||||
      await run();
 | 
			
		||||
 | 
			
		||||
      expect(getInputSpy).not.toHaveBeenCalled();
 | 
			
		||||
      expect(getStateSpy).toHaveBeenCalledTimes(4);
 | 
			
		||||
      expect(getInputSpy).toHaveBeenCalled();
 | 
			
		||||
      expect(getStateSpy).toHaveBeenCalledTimes(3);
 | 
			
		||||
      expect(getCommandOutputSpy).toHaveBeenCalledTimes(0);
 | 
			
		||||
      expect(debugSpy).toHaveBeenCalledTimes(0);
 | 
			
		||||
      expect(infoSpy).toHaveBeenCalledWith(
 | 
			
		||||
@ -135,9 +130,7 @@ describe('run', () => {
 | 
			
		||||
    it('should not save cache for yarn2', async () => {
 | 
			
		||||
      inputs['cache'] = 'yarn';
 | 
			
		||||
      getStateSpy.mockImplementation(key =>
 | 
			
		||||
        key === State.CachePackageManager
 | 
			
		||||
          ? inputs['cache']
 | 
			
		||||
          : key === State.CachePrimaryKey || key === State.CacheMatchedKey
 | 
			
		||||
        key === State.CachePrimaryKey || key === State.CacheMatchedKey
 | 
			
		||||
          ? yarnFileHash
 | 
			
		||||
          : key === State.CachePaths
 | 
			
		||||
          ? '["/foo/bar"]'
 | 
			
		||||
@ -146,8 +139,8 @@ describe('run', () => {
 | 
			
		||||
 | 
			
		||||
      await run();
 | 
			
		||||
 | 
			
		||||
      expect(getInputSpy).not.toHaveBeenCalled();
 | 
			
		||||
      expect(getStateSpy).toHaveBeenCalledTimes(4);
 | 
			
		||||
      expect(getInputSpy).toHaveBeenCalled();
 | 
			
		||||
      expect(getStateSpy).toHaveBeenCalledTimes(3);
 | 
			
		||||
      expect(getCommandOutputSpy).toHaveBeenCalledTimes(0);
 | 
			
		||||
      expect(debugSpy).toHaveBeenCalledTimes(0);
 | 
			
		||||
      expect(infoSpy).toHaveBeenCalledWith(
 | 
			
		||||
@ -159,9 +152,7 @@ describe('run', () => {
 | 
			
		||||
    it('should not save cache for npm', async () => {
 | 
			
		||||
      inputs['cache'] = 'npm';
 | 
			
		||||
      getStateSpy.mockImplementation(key =>
 | 
			
		||||
        key === State.CachePackageManager
 | 
			
		||||
          ? inputs['cache']
 | 
			
		||||
          : key === State.CachePrimaryKey || key === State.CacheMatchedKey
 | 
			
		||||
        key === State.CachePrimaryKey || key === State.CacheMatchedKey
 | 
			
		||||
          ? yarnFileHash
 | 
			
		||||
          : key === State.CachePaths
 | 
			
		||||
          ? '["/foo/bar"]'
 | 
			
		||||
@ -171,8 +162,8 @@ describe('run', () => {
 | 
			
		||||
 | 
			
		||||
      await run();
 | 
			
		||||
 | 
			
		||||
      expect(getInputSpy).not.toHaveBeenCalled();
 | 
			
		||||
      expect(getStateSpy).toHaveBeenCalledTimes(4);
 | 
			
		||||
      expect(getInputSpy).toHaveBeenCalled();
 | 
			
		||||
      expect(getStateSpy).toHaveBeenCalledTimes(3);
 | 
			
		||||
      expect(getCommandOutputSpy).toHaveBeenCalledTimes(0);
 | 
			
		||||
      expect(debugSpy).toHaveBeenCalledTimes(0);
 | 
			
		||||
      expect(setFailedSpy).not.toHaveBeenCalled();
 | 
			
		||||
@ -181,9 +172,7 @@ describe('run', () => {
 | 
			
		||||
    it('should not save cache for pnpm', async () => {
 | 
			
		||||
      inputs['cache'] = 'pnpm';
 | 
			
		||||
      getStateSpy.mockImplementation(key =>
 | 
			
		||||
        key === State.CachePackageManager
 | 
			
		||||
          ? inputs['cache']
 | 
			
		||||
          : key === State.CachePrimaryKey || key === State.CacheMatchedKey
 | 
			
		||||
        key === State.CachePrimaryKey || key === State.CacheMatchedKey
 | 
			
		||||
          ? yarnFileHash
 | 
			
		||||
          : key === State.CachePaths
 | 
			
		||||
          ? '["/foo/bar"]'
 | 
			
		||||
@ -192,8 +181,8 @@ describe('run', () => {
 | 
			
		||||
 | 
			
		||||
      await run();
 | 
			
		||||
 | 
			
		||||
      expect(getInputSpy).not.toHaveBeenCalled();
 | 
			
		||||
      expect(getStateSpy).toHaveBeenCalledTimes(4);
 | 
			
		||||
      expect(getInputSpy).toHaveBeenCalled();
 | 
			
		||||
      expect(getStateSpy).toHaveBeenCalledTimes(3);
 | 
			
		||||
      expect(getCommandOutputSpy).toHaveBeenCalledTimes(0);
 | 
			
		||||
      expect(debugSpy).toHaveBeenCalledTimes(0);
 | 
			
		||||
      expect(setFailedSpy).not.toHaveBeenCalled();
 | 
			
		||||
@ -204,9 +193,7 @@ describe('run', () => {
 | 
			
		||||
    it('saves cache from yarn 1', async () => {
 | 
			
		||||
      inputs['cache'] = 'yarn';
 | 
			
		||||
      getStateSpy.mockImplementation((key: string) =>
 | 
			
		||||
        key === State.CachePackageManager
 | 
			
		||||
          ? inputs['cache']
 | 
			
		||||
          : key === State.CacheMatchedKey
 | 
			
		||||
        key === State.CacheMatchedKey
 | 
			
		||||
          ? yarnFileHash
 | 
			
		||||
          : key === State.CachePrimaryKey
 | 
			
		||||
          ? npmFileHash
 | 
			
		||||
@ -217,8 +204,8 @@ describe('run', () => {
 | 
			
		||||
 | 
			
		||||
      await run();
 | 
			
		||||
 | 
			
		||||
      expect(getInputSpy).not.toHaveBeenCalled();
 | 
			
		||||
      expect(getStateSpy).toHaveBeenCalledTimes(4);
 | 
			
		||||
      expect(getInputSpy).toHaveBeenCalled();
 | 
			
		||||
      expect(getStateSpy).toHaveBeenCalledTimes(3);
 | 
			
		||||
      expect(getCommandOutputSpy).toHaveBeenCalledTimes(0);
 | 
			
		||||
      expect(debugSpy).toHaveBeenCalledTimes(0);
 | 
			
		||||
      expect(infoSpy).not.toHaveBeenCalledWith(
 | 
			
		||||
@ -234,9 +221,7 @@ describe('run', () => {
 | 
			
		||||
    it('saves cache from yarn 2', async () => {
 | 
			
		||||
      inputs['cache'] = 'yarn';
 | 
			
		||||
      getStateSpy.mockImplementation((key: string) =>
 | 
			
		||||
        key === State.CachePackageManager
 | 
			
		||||
          ? inputs['cache']
 | 
			
		||||
          : key === State.CacheMatchedKey
 | 
			
		||||
        key === State.CacheMatchedKey
 | 
			
		||||
          ? yarnFileHash
 | 
			
		||||
          : key === State.CachePrimaryKey
 | 
			
		||||
          ? npmFileHash
 | 
			
		||||
@ -247,8 +232,8 @@ describe('run', () => {
 | 
			
		||||
 | 
			
		||||
      await run();
 | 
			
		||||
 | 
			
		||||
      expect(getInputSpy).not.toHaveBeenCalled();
 | 
			
		||||
      expect(getStateSpy).toHaveBeenCalledTimes(4);
 | 
			
		||||
      expect(getInputSpy).toHaveBeenCalled();
 | 
			
		||||
      expect(getStateSpy).toHaveBeenCalledTimes(3);
 | 
			
		||||
      expect(getCommandOutputSpy).toHaveBeenCalledTimes(0);
 | 
			
		||||
      expect(debugSpy).toHaveBeenCalledTimes(0);
 | 
			
		||||
      expect(infoSpy).not.toHaveBeenCalledWith(
 | 
			
		||||
@ -264,9 +249,7 @@ describe('run', () => {
 | 
			
		||||
    it('saves cache from npm', async () => {
 | 
			
		||||
      inputs['cache'] = 'npm';
 | 
			
		||||
      getStateSpy.mockImplementation((key: string) =>
 | 
			
		||||
        key === State.CachePackageManager
 | 
			
		||||
          ? inputs['cache']
 | 
			
		||||
          : key === State.CacheMatchedKey
 | 
			
		||||
        key === State.CacheMatchedKey
 | 
			
		||||
          ? npmFileHash
 | 
			
		||||
          : key === State.CachePrimaryKey
 | 
			
		||||
          ? yarnFileHash
 | 
			
		||||
@ -277,8 +260,8 @@ describe('run', () => {
 | 
			
		||||
 | 
			
		||||
      await run();
 | 
			
		||||
 | 
			
		||||
      expect(getInputSpy).not.toHaveBeenCalled();
 | 
			
		||||
      expect(getStateSpy).toHaveBeenCalledTimes(4);
 | 
			
		||||
      expect(getInputSpy).toHaveBeenCalled();
 | 
			
		||||
      expect(getStateSpy).toHaveBeenCalledTimes(3);
 | 
			
		||||
      expect(getCommandOutputSpy).toHaveBeenCalledTimes(0);
 | 
			
		||||
      expect(debugSpy).toHaveBeenCalledTimes(0);
 | 
			
		||||
      expect(infoSpy).not.toHaveBeenCalledWith(
 | 
			
		||||
@ -294,9 +277,7 @@ describe('run', () => {
 | 
			
		||||
    it('saves cache from pnpm', async () => {
 | 
			
		||||
      inputs['cache'] = 'pnpm';
 | 
			
		||||
      getStateSpy.mockImplementation((key: string) =>
 | 
			
		||||
        key === State.CachePackageManager
 | 
			
		||||
          ? inputs['cache']
 | 
			
		||||
          : key === State.CacheMatchedKey
 | 
			
		||||
        key === State.CacheMatchedKey
 | 
			
		||||
          ? pnpmFileHash
 | 
			
		||||
          : key === State.CachePrimaryKey
 | 
			
		||||
          ? npmFileHash
 | 
			
		||||
@ -307,8 +288,8 @@ describe('run', () => {
 | 
			
		||||
 | 
			
		||||
      await run();
 | 
			
		||||
 | 
			
		||||
      expect(getInputSpy).not.toHaveBeenCalled();
 | 
			
		||||
      expect(getStateSpy).toHaveBeenCalledTimes(4);
 | 
			
		||||
      expect(getInputSpy).toHaveBeenCalled();
 | 
			
		||||
      expect(getStateSpy).toHaveBeenCalledTimes(3);
 | 
			
		||||
      expect(getCommandOutputSpy).toHaveBeenCalledTimes(0);
 | 
			
		||||
      expect(debugSpy).toHaveBeenCalledTimes(0);
 | 
			
		||||
      expect(infoSpy).not.toHaveBeenCalledWith(
 | 
			
		||||
@ -324,9 +305,7 @@ describe('run', () => {
 | 
			
		||||
    it('save with -1 cacheId , should not fail workflow', async () => {
 | 
			
		||||
      inputs['cache'] = 'npm';
 | 
			
		||||
      getStateSpy.mockImplementation((key: string) =>
 | 
			
		||||
        key === State.CachePackageManager
 | 
			
		||||
          ? inputs['cache']
 | 
			
		||||
          : key === State.CacheMatchedKey
 | 
			
		||||
        key === State.CacheMatchedKey
 | 
			
		||||
          ? npmFileHash
 | 
			
		||||
          : key === State.CachePrimaryKey
 | 
			
		||||
          ? yarnFileHash
 | 
			
		||||
@ -340,8 +319,8 @@ describe('run', () => {
 | 
			
		||||
 | 
			
		||||
      await run();
 | 
			
		||||
 | 
			
		||||
      expect(getInputSpy).not.toHaveBeenCalled();
 | 
			
		||||
      expect(getStateSpy).toHaveBeenCalledTimes(4);
 | 
			
		||||
      expect(getInputSpy).toHaveBeenCalled();
 | 
			
		||||
      expect(getStateSpy).toHaveBeenCalledTimes(3);
 | 
			
		||||
      expect(getCommandOutputSpy).toHaveBeenCalledTimes(0);
 | 
			
		||||
      expect(debugSpy).toHaveBeenCalledTimes(0);
 | 
			
		||||
      expect(infoSpy).not.toHaveBeenCalledWith(
 | 
			
		||||
@ -357,9 +336,7 @@ describe('run', () => {
 | 
			
		||||
    it('saves with error from toolkit, should fail workflow', async () => {
 | 
			
		||||
      inputs['cache'] = 'npm';
 | 
			
		||||
      getStateSpy.mockImplementation((key: string) =>
 | 
			
		||||
        key === State.CachePackageManager
 | 
			
		||||
          ? inputs['cache']
 | 
			
		||||
          : key === State.CacheMatchedKey
 | 
			
		||||
        key === State.CacheMatchedKey
 | 
			
		||||
          ? npmFileHash
 | 
			
		||||
          : key === State.CachePrimaryKey
 | 
			
		||||
          ? yarnFileHash
 | 
			
		||||
@ -373,8 +350,8 @@ describe('run', () => {
 | 
			
		||||
 | 
			
		||||
      await run();
 | 
			
		||||
 | 
			
		||||
      expect(getInputSpy).not.toHaveBeenCalled();
 | 
			
		||||
      expect(getStateSpy).toHaveBeenCalledTimes(4);
 | 
			
		||||
      expect(getInputSpy).toHaveBeenCalled();
 | 
			
		||||
      expect(getStateSpy).toHaveBeenCalledTimes(3);
 | 
			
		||||
      expect(getCommandOutputSpy).toHaveBeenCalledTimes(0);
 | 
			
		||||
      expect(debugSpy).toHaveBeenCalledTimes(0);
 | 
			
		||||
      expect(infoSpy).not.toHaveBeenCalledWith(
 | 
			
		||||
 | 
			
		||||
@ -6,7 +6,8 @@ import {
 | 
			
		||||
  PackageManagerInfo,
 | 
			
		||||
  isCacheFeatureAvailable,
 | 
			
		||||
  supportedPackageManagers,
 | 
			
		||||
  getProjectDirectoriesFromCacheDependencyPath
 | 
			
		||||
  getCommandOutput,
 | 
			
		||||
  resetProjectDirectoriesMemoized
 | 
			
		||||
} from '../src/cache-utils';
 | 
			
		||||
import fs from 'fs';
 | 
			
		||||
import * as cacheUtils from '../src/cache-utils';
 | 
			
		||||
@ -122,7 +123,7 @@ describe('cache-utils', () => {
 | 
			
		||||
          MockGlobber.create(['/foo', '/bar'])
 | 
			
		||||
      );
 | 
			
		||||
 | 
			
		||||
      getProjectDirectoriesFromCacheDependencyPath.cache.clear?.();
 | 
			
		||||
      resetProjectDirectoriesMemoized();
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
    afterEach(() => {
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										1578
									
								
								dist/cache-save/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1578
									
								
								dist/cache-save/index.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										3327
									
								
								dist/setup/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3327
									
								
								dist/setup/index.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										101
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										101
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							@ -17,14 +17,14 @@
 | 
			
		||||
        "@actions/http-client": "^1.0.11",
 | 
			
		||||
        "@actions/io": "^1.0.2",
 | 
			
		||||
        "@actions/tool-cache": "^1.5.4",
 | 
			
		||||
        "lodash.memoize": "^4.1.2",
 | 
			
		||||
        "semver": "^6.3.1"
 | 
			
		||||
        "semver": "^6.3.1",
 | 
			
		||||
        "uuid": "^9.0.0"
 | 
			
		||||
      },
 | 
			
		||||
      "devDependencies": {
 | 
			
		||||
        "@types/jest": "^27.0.2",
 | 
			
		||||
        "@types/lodash.memoize": "^4.1.7",
 | 
			
		||||
        "@types/node": "^16.11.25",
 | 
			
		||||
        "@types/semver": "^6.0.0",
 | 
			
		||||
        "@types/uuid": "^9.0.3",
 | 
			
		||||
        "@typescript-eslint/eslint-plugin": "^5.54.0",
 | 
			
		||||
        "@typescript-eslint/parser": "^5.54.0",
 | 
			
		||||
        "@vercel/ncc": "^0.33.4",
 | 
			
		||||
@ -160,6 +160,15 @@
 | 
			
		||||
        "uuid": "^3.3.2"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@actions/tool-cache/node_modules/uuid": {
 | 
			
		||||
      "version": "3.4.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
 | 
			
		||||
      "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==",
 | 
			
		||||
      "deprecated": "Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.",
 | 
			
		||||
      "bin": {
 | 
			
		||||
        "uuid": "bin/uuid"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@azure/abort-controller": {
 | 
			
		||||
      "version": "1.1.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@azure/abort-controller/-/abort-controller-1.1.0.tgz",
 | 
			
		||||
@ -1650,21 +1659,6 @@
 | 
			
		||||
      "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==",
 | 
			
		||||
      "dev": true
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@types/lodash": {
 | 
			
		||||
      "version": "4.14.197",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.197.tgz",
 | 
			
		||||
      "integrity": "sha512-BMVOiWs0uNxHVlHBgzTIqJYmj+PgCo4euloGF+5m4okL3rEYzM2EEv78mw8zWSMM57dM7kVIgJ2QDvwHSoCI5g==",
 | 
			
		||||
      "dev": true
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@types/lodash.memoize": {
 | 
			
		||||
      "version": "4.1.7",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@types/lodash.memoize/-/lodash.memoize-4.1.7.tgz",
 | 
			
		||||
      "integrity": "sha512-lGN7WeO4vO6sICVpf041Q7BX/9k1Y24Zo3FY0aUezr1QlKznpjzsDk3T3wvH8ofYzoK0QupN9TWcFAFZlyPwQQ==",
 | 
			
		||||
      "dev": true,
 | 
			
		||||
      "dependencies": {
 | 
			
		||||
        "@types/lodash": "*"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@types/node": {
 | 
			
		||||
      "version": "16.11.25",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.25.tgz",
 | 
			
		||||
@ -1705,6 +1699,12 @@
 | 
			
		||||
        "@types/node": "*"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@types/uuid": {
 | 
			
		||||
      "version": "9.0.3",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.3.tgz",
 | 
			
		||||
      "integrity": "sha512-taHQQH/3ZyI3zP8M/puluDEIEvtQHVYcC6y3N8ijFtAd28+Ey/G4sg1u2gB01S8MwybLOKAp9/yCMu/uR5l3Ug==",
 | 
			
		||||
      "dev": true
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/@types/yargs": {
 | 
			
		||||
      "version": "16.0.4",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz",
 | 
			
		||||
@ -4989,11 +4989,6 @@
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz",
 | 
			
		||||
      "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk="
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/lodash.memoize": {
 | 
			
		||||
      "version": "4.1.2",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz",
 | 
			
		||||
      "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag=="
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/lodash.merge": {
 | 
			
		||||
      "version": "4.6.2",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
 | 
			
		||||
@ -6191,12 +6186,11 @@
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/uuid": {
 | 
			
		||||
      "version": "3.3.2",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz",
 | 
			
		||||
      "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==",
 | 
			
		||||
      "deprecated": "Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.",
 | 
			
		||||
      "version": "9.0.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz",
 | 
			
		||||
      "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==",
 | 
			
		||||
      "bin": {
 | 
			
		||||
        "uuid": "bin/uuid"
 | 
			
		||||
        "uuid": "dist/bin/uuid"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/v8-to-istanbul": {
 | 
			
		||||
@ -6313,9 +6307,9 @@
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "node_modules/word-wrap": {
 | 
			
		||||
      "version": "1.2.4",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz",
 | 
			
		||||
      "integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==",
 | 
			
		||||
      "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==",
 | 
			
		||||
      "dev": true,
 | 
			
		||||
      "engines": {
 | 
			
		||||
        "node": ">=0.10.0"
 | 
			
		||||
@ -6579,6 +6573,13 @@
 | 
			
		||||
        "@actions/io": "^1.0.1",
 | 
			
		||||
        "semver": "^6.1.0",
 | 
			
		||||
        "uuid": "^3.3.2"
 | 
			
		||||
      },
 | 
			
		||||
      "dependencies": {
 | 
			
		||||
        "uuid": {
 | 
			
		||||
          "version": "3.4.0",
 | 
			
		||||
          "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
 | 
			
		||||
          "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A=="
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "@azure/abort-controller": {
 | 
			
		||||
@ -7802,21 +7803,6 @@
 | 
			
		||||
      "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==",
 | 
			
		||||
      "dev": true
 | 
			
		||||
    },
 | 
			
		||||
    "@types/lodash": {
 | 
			
		||||
      "version": "4.14.197",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.197.tgz",
 | 
			
		||||
      "integrity": "sha512-BMVOiWs0uNxHVlHBgzTIqJYmj+PgCo4euloGF+5m4okL3rEYzM2EEv78mw8zWSMM57dM7kVIgJ2QDvwHSoCI5g==",
 | 
			
		||||
      "dev": true
 | 
			
		||||
    },
 | 
			
		||||
    "@types/lodash.memoize": {
 | 
			
		||||
      "version": "4.1.7",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@types/lodash.memoize/-/lodash.memoize-4.1.7.tgz",
 | 
			
		||||
      "integrity": "sha512-lGN7WeO4vO6sICVpf041Q7BX/9k1Y24Zo3FY0aUezr1QlKznpjzsDk3T3wvH8ofYzoK0QupN9TWcFAFZlyPwQQ==",
 | 
			
		||||
      "dev": true,
 | 
			
		||||
      "requires": {
 | 
			
		||||
        "@types/lodash": "*"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "@types/node": {
 | 
			
		||||
      "version": "16.11.25",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.25.tgz",
 | 
			
		||||
@ -7857,6 +7843,12 @@
 | 
			
		||||
        "@types/node": "*"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "@types/uuid": {
 | 
			
		||||
      "version": "9.0.3",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.3.tgz",
 | 
			
		||||
      "integrity": "sha512-taHQQH/3ZyI3zP8M/puluDEIEvtQHVYcC6y3N8ijFtAd28+Ey/G4sg1u2gB01S8MwybLOKAp9/yCMu/uR5l3Ug==",
 | 
			
		||||
      "dev": true
 | 
			
		||||
    },
 | 
			
		||||
    "@types/yargs": {
 | 
			
		||||
      "version": "16.0.4",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-16.0.4.tgz",
 | 
			
		||||
@ -10281,11 +10273,6 @@
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz",
 | 
			
		||||
      "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk="
 | 
			
		||||
    },
 | 
			
		||||
    "lodash.memoize": {
 | 
			
		||||
      "version": "4.1.2",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz",
 | 
			
		||||
      "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag=="
 | 
			
		||||
    },
 | 
			
		||||
    "lodash.merge": {
 | 
			
		||||
      "version": "4.6.2",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz",
 | 
			
		||||
@ -11156,9 +11143,9 @@
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "uuid": {
 | 
			
		||||
      "version": "3.3.2",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz",
 | 
			
		||||
      "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA=="
 | 
			
		||||
      "version": "9.0.0",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz",
 | 
			
		||||
      "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg=="
 | 
			
		||||
    },
 | 
			
		||||
    "v8-to-istanbul": {
 | 
			
		||||
      "version": "8.1.0",
 | 
			
		||||
@ -11255,9 +11242,9 @@
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "word-wrap": {
 | 
			
		||||
      "version": "1.2.4",
 | 
			
		||||
      "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz",
 | 
			
		||||
      "integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==",
 | 
			
		||||
      "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==",
 | 
			
		||||
      "dev": true
 | 
			
		||||
    },
 | 
			
		||||
    "wrap-ansi": {
 | 
			
		||||
 | 
			
		||||
@ -33,14 +33,14 @@
 | 
			
		||||
    "@actions/http-client": "^1.0.11",
 | 
			
		||||
    "@actions/io": "^1.0.2",
 | 
			
		||||
    "@actions/tool-cache": "^1.5.4",
 | 
			
		||||
    "lodash.memoize": "^4.1.2",
 | 
			
		||||
    "semver": "^6.3.1"
 | 
			
		||||
    "semver": "^6.3.1",
 | 
			
		||||
    "uuid": "^9.0.0"
 | 
			
		||||
  },
 | 
			
		||||
  "devDependencies": {
 | 
			
		||||
    "@types/jest": "^27.0.2",
 | 
			
		||||
    "@types/lodash.memoize": "^4.1.7",
 | 
			
		||||
    "@types/node": "^16.11.25",
 | 
			
		||||
    "@types/semver": "^6.0.0",
 | 
			
		||||
    "@types/uuid": "^9.0.3",
 | 
			
		||||
    "@typescript-eslint/eslint-plugin": "^5.54.0",
 | 
			
		||||
    "@typescript-eslint/parser": "^5.54.0",
 | 
			
		||||
    "@vercel/ncc": "^0.33.4",
 | 
			
		||||
 | 
			
		||||
@ -1,6 +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';
 | 
			
		||||
 | 
			
		||||
@ -14,7 +16,7 @@ process.on('uncaughtException', e => {
 | 
			
		||||
 | 
			
		||||
export async function run() {
 | 
			
		||||
  try {
 | 
			
		||||
    const cacheLock = core.getState(State.CachePackageManager);
 | 
			
		||||
    const cacheLock = core.getInput('cache');
 | 
			
		||||
    await cachePackages(cacheLock);
 | 
			
		||||
  } catch (error) {
 | 
			
		||||
    core.setFailed(error.message);
 | 
			
		||||
@ -24,9 +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(
 | 
			
		||||
  let cachePaths = JSON.parse(
 | 
			
		||||
    core.getState(State.CachePaths) || '[]'
 | 
			
		||||
  ) as string[];
 | 
			
		||||
  cachePaths = cachePaths.filter(fs.existsSync);
 | 
			
		||||
 | 
			
		||||
  const packageManagerInfo = await getPackageManagerInfo(packageManager);
 | 
			
		||||
  if (!packageManagerInfo) {
 | 
			
		||||
 | 
			
		||||
@ -2,7 +2,6 @@ import * as core from '@actions/core';
 | 
			
		||||
import * as exec from '@actions/exec';
 | 
			
		||||
import * as cache from '@actions/cache';
 | 
			
		||||
import * as glob from '@actions/glob';
 | 
			
		||||
import memoize from 'lodash.memoize';
 | 
			
		||||
import path from 'path';
 | 
			
		||||
import fs from 'fs';
 | 
			
		||||
import {unique} from './util';
 | 
			
		||||
@ -112,38 +111,50 @@ export const getPackageManagerInfo = async (packageManager: string) => {
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Expands (converts) the string input `cache-dependency-path` to list of directories that
 | 
			
		||||
 * may be project roots
 | 
			
		||||
 *
 | 
			
		||||
 * getProjectDirectoriesFromCacheDependencyPath is called twice during `restoreCache`
 | 
			
		||||
 *  - first through `getCacheDirectories`
 | 
			
		||||
 *  - second from `repoHasYarn3ManagedCache`
 | 
			
		||||
 *
 | 
			
		||||
 * it contains expensive IO operation and thus should be memoized
 | 
			
		||||
 *
 | 
			
		||||
 *  it contains expensive IO operation and thus should be memoized
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
let projectDirectoriesMemoized: string[] | null = null;
 | 
			
		||||
/**
 | 
			
		||||
 * unit test must reset memoized variables
 | 
			
		||||
 */
 | 
			
		||||
export const resetProjectDirectoriesMemoized = () =>
 | 
			
		||||
  (projectDirectoriesMemoized = null);
 | 
			
		||||
/**
 | 
			
		||||
 * Expands (converts) the string input `cache-dependency-path` to list of directories that
 | 
			
		||||
 * may be project roots
 | 
			
		||||
 * @param cacheDependencyPath - either a single string or multiline string with possible glob patterns
 | 
			
		||||
 *                              expected to be the result of `core.getInput('cache-dependency-path')`
 | 
			
		||||
 * @return list of directories
 | 
			
		||||
 * @return list of directories and possible
 | 
			
		||||
 */
 | 
			
		||||
export const getProjectDirectoriesFromCacheDependencyPath = memoize(
 | 
			
		||||
  async (cacheDependencyPath: string): Promise<string[]> => {
 | 
			
		||||
    const globber = await glob.create(cacheDependencyPath);
 | 
			
		||||
    const cacheDependenciesPaths = await globber.glob();
 | 
			
		||||
 | 
			
		||||
    const existingDirectories: string[] = cacheDependenciesPaths
 | 
			
		||||
      .map(path.dirname)
 | 
			
		||||
      .filter(unique())
 | 
			
		||||
      .map(dirName => fs.realpathSync(dirName))
 | 
			
		||||
      .filter(directory => fs.lstatSync(directory).isDirectory());
 | 
			
		||||
 | 
			
		||||
    if (!existingDirectories.length)
 | 
			
		||||
      core.warning(
 | 
			
		||||
        `No existing directories found containing cache-dependency-path="${cacheDependencyPath}"`
 | 
			
		||||
      );
 | 
			
		||||
 | 
			
		||||
    return existingDirectories;
 | 
			
		||||
const getProjectDirectoriesFromCacheDependencyPath = async (
 | 
			
		||||
  cacheDependencyPath: string
 | 
			
		||||
): Promise<string[]> => {
 | 
			
		||||
  if (projectDirectoriesMemoized !== null) {
 | 
			
		||||
    return projectDirectoriesMemoized;
 | 
			
		||||
  }
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
  const globber = await glob.create(cacheDependencyPath);
 | 
			
		||||
  const cacheDependenciesPaths = await globber.glob();
 | 
			
		||||
 | 
			
		||||
  const existingDirectories: string[] = cacheDependenciesPaths
 | 
			
		||||
    .map(path.dirname)
 | 
			
		||||
    .filter(unique())
 | 
			
		||||
    .map(dirName => fs.realpathSync(dirName))
 | 
			
		||||
    .filter(directory => fs.lstatSync(directory).isDirectory());
 | 
			
		||||
 | 
			
		||||
  if (!existingDirectories.length)
 | 
			
		||||
    core.warning(
 | 
			
		||||
      `No existing directories found containing cache-dependency-path="${cacheDependencyPath}"`
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
  projectDirectoriesMemoized = existingDirectories;
 | 
			
		||||
  return existingDirectories;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Finds the cache directories configured for the repo if cache-dependency-path is not empty
 | 
			
		||||
 | 
			
		||||
@ -5,7 +5,6 @@ export enum LockType {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export enum State {
 | 
			
		||||
  CachePackageManager = 'SETUP_NODE_CACHE_PACKAGE_MANAGER',
 | 
			
		||||
  CachePrimaryKey = 'CACHE_KEY',
 | 
			
		||||
  CacheMatchedKey = 'CACHE_RESULT',
 | 
			
		||||
  CachePaths = 'CACHE_PATHS'
 | 
			
		||||
 | 
			
		||||
@ -1,3 +1,4 @@
 | 
			
		||||
import {v4 as uuidv4} from 'uuid';
 | 
			
		||||
import * as tc from '@actions/tool-cache';
 | 
			
		||||
import * as hc from '@actions/http-client';
 | 
			
		||||
import * as core from '@actions/core';
 | 
			
		||||
@ -166,9 +167,8 @@ export default abstract class BaseDistribution {
 | 
			
		||||
    const initialUrl = this.getDistributionUrl();
 | 
			
		||||
    const osArch: string = this.translateArchToDistUrl(arch);
 | 
			
		||||
 | 
			
		||||
    // Create temporary folder to download in to
 | 
			
		||||
    const tempDownloadFolder: string =
 | 
			
		||||
      'temp_' + Math.floor(Math.random() * 2000000000);
 | 
			
		||||
    // Create temporary folder to download to
 | 
			
		||||
    const tempDownloadFolder = `temp_${uuidv4()}`;
 | 
			
		||||
    const tempDirectory = process.env['RUNNER_TEMP'] || '';
 | 
			
		||||
    assert.ok(tempDirectory, 'Expected RUNNER_TEMP to be defined');
 | 
			
		||||
    const tempDir: string = path.join(tempDirectory, tempDownloadFolder);
 | 
			
		||||
 | 
			
		||||
@ -9,7 +9,6 @@ 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 {
 | 
			
		||||
@ -61,7 +60,6 @@ export async function run() {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (cache && isCacheFeatureAvailable()) {
 | 
			
		||||
      core.saveState(State.CachePackageManager, cache);
 | 
			
		||||
      const cacheDependencyPath = core.getInput('cache-dependency-path');
 | 
			
		||||
      await restoreCache(cache, cacheDependencyPath);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user