mirror of
				https://github.com/actions/setup-go.git
				synced 2025-10-31 23:53:42 +00:00 
			
		
		
		
	add fix for cache
This commit is contained in:
		
							parent
							
								
									81a4a5d661
								
							
						
					
					
						commit
						1cdc56af28
					
				
							
								
								
									
										2
									
								
								.github/workflows/check-dist.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/check-dist.yml
									
									
									
									
										vendored
									
									
								
							| @ -16,4 +16,4 @@ jobs: | ||||
|     name: Check dist/ | ||||
|     uses: actions/reusable-workflows/.github/workflows/check-dist.yml@main | ||||
|     with: | ||||
|       node-version: '20' | ||||
|       node-version: '20' | ||||
|  | ||||
							
								
								
									
										19
									
								
								dist/cache-save/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										19
									
								
								dist/cache-save/index.js
									
									
									
									
										vendored
									
									
								
							| @ -80816,10 +80816,19 @@ process.on('uncaughtException', e => { | ||||
|     const warningPrefix = '[warning]'; | ||||
|     core.info(`${warningPrefix}${e.message}`); | ||||
| }); | ||||
| function run() { | ||||
| // Added early exit to resolve issue with slow post action step:
 | ||||
| // - https://github.com/actions/setup-node/issues/878
 | ||||
| // https://github.com/actions/cache/pull/1217
 | ||||
| function run(earlyExit) { | ||||
|     return __awaiter(this, void 0, void 0, function* () { | ||||
|         try { | ||||
|             yield cachePackages(); | ||||
|             const cacheInput = core.getBooleanInput('cache'); | ||||
|             if (cacheInput) { | ||||
|                 yield cachePackages(); | ||||
|                 if (earlyExit) { | ||||
|                     process.exit(0); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|         catch (error) { | ||||
|             let message = 'Unknown error!'; | ||||
| @ -80835,10 +80844,6 @@ function run() { | ||||
| } | ||||
| exports.run = run; | ||||
| const cachePackages = () => __awaiter(void 0, void 0, void 0, function* () { | ||||
|     const cacheInput = core.getBooleanInput('cache'); | ||||
|     if (!cacheInput) { | ||||
|         return; | ||||
|     } | ||||
|     const packageManager = 'default'; | ||||
|     const state = core.getState(constants_1.State.CacheMatchedKey); | ||||
|     const primaryKey = core.getState(constants_1.State.CachePrimaryKey); | ||||
| @ -80870,7 +80875,7 @@ function logWarning(message) { | ||||
|     const warningPrefix = '[warning]'; | ||||
|     core.info(`${warningPrefix}${message}`); | ||||
| } | ||||
| run(); | ||||
| run(true); | ||||
| 
 | ||||
| 
 | ||||
| /***/ }), | ||||
|  | ||||
| @ -12,9 +12,19 @@ process.on('uncaughtException', e => { | ||||
|   core.info(`${warningPrefix}${e.message}`); | ||||
| }); | ||||
| 
 | ||||
| export async function run() { | ||||
| // Added early exit to resolve issue with slow post action step:
 | ||||
| // - https://github.com/actions/setup-node/issues/878
 | ||||
| // https://github.com/actions/cache/pull/1217
 | ||||
| export async function run(earlyExit?: boolean) { | ||||
|   try { | ||||
|     await cachePackages(); | ||||
|     const cacheInput = core.getBooleanInput('cache'); | ||||
|     if (cacheInput) { | ||||
|       await cachePackages(); | ||||
| 
 | ||||
|       if (earlyExit) { | ||||
|         process.exit(0); | ||||
|       } | ||||
|     } | ||||
|   } catch (error) { | ||||
|     let message = 'Unknown error!'; | ||||
|     if (error instanceof Error) { | ||||
| @ -28,11 +38,6 @@ export async function run() { | ||||
| } | ||||
| 
 | ||||
| const cachePackages = async () => { | ||||
|   const cacheInput = core.getBooleanInput('cache'); | ||||
|   if (!cacheInput) { | ||||
|     return; | ||||
|   } | ||||
| 
 | ||||
|   const packageManager = 'default'; | ||||
| 
 | ||||
|   const state = core.getState(State.CacheMatchedKey); | ||||
| @ -85,4 +90,4 @@ function logWarning(message: string): void { | ||||
|   core.info(`${warningPrefix}${message}`); | ||||
| } | ||||
| 
 | ||||
| run(); | ||||
| run(true); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user