mirror of
				https://github.com/actions/setup-node.git
				synced 2025-10-31 16:14:00 +08:00 
			
		
		
		
	change getinput to getstate for cache (#816)
This commit is contained in:
		| @@ -16,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); | ||||
|   | ||||
| @@ -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' | ||||
|   | ||||
| @@ -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); | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Dmitry Shibanov
					Dmitry Shibanov