mirror of
				https://github.com/actions/cache.git
				synced 2025-10-31 03:38:36 +08:00 
			
		
		
		
	Merge remote-tracking branch 'upstream/main' into fix/v4-update
This commit is contained in:
		
						commit
						4c85713eab
					
				
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@actions/cache.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@actions/cache.dep.yml
									
									
									
										generated
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										150
									
								
								RELEASES.md
									
									
									
									
									
								
							
							
						
						
									
										150
									
								
								RELEASES.md
									
									
									
									
									
								
							|  | @ -1,77 +1,54 @@ | ||||||
| # Releases | # Releases | ||||||
| 
 | 
 | ||||||
| ### 3.0.0 | ### 4.0.2 | ||||||
| 
 | 
 | ||||||
| - Updated minimum runner version support from node 12 -> node 16 | - Fixed restore `fail-on-cache-miss` not working. | ||||||
| 
 | 
 | ||||||
| ### 3.0.1 | ### 4.0.1 | ||||||
| 
 | 
 | ||||||
| - Added support for caching from GHES 3.5. | - Updated `isGhes` check | ||||||
| - Fixed download issue for files > 2GB during restore. |  | ||||||
| 
 | 
 | ||||||
| ### 3.0.2 | ### 4.0.0 | ||||||
| 
 | 
 | ||||||
| - Added support for dynamic cache size cap on GHES. | - Updated minimum runner version support from node 12 -> node 20 | ||||||
| 
 | 
 | ||||||
| ### 3.0.3 | ### 3.3.3 | ||||||
| 
 | 
 | ||||||
| - Fixed avoiding empty cache save when no files are available for caching. ([issue](https://github.com/actions/cache/issues/624)) | - Updates @actions/cache to v3.2.3 to fix accidental mutated path arguments to `getCacheVersion` [actions/toolkit#1378](https://github.com/actions/toolkit/pull/1378) | ||||||
|  | - Additional audit fixes of npm package(s) | ||||||
| 
 | 
 | ||||||
| ### 3.0.4 | ### 3.3.2 | ||||||
| 
 | 
 | ||||||
| - Fixed tar creation error while trying to create tar with path as `~/` home folder on `ubuntu-latest`. ([issue](https://github.com/actions/cache/issues/689)) | - Fixes bug with Azure SDK causing blob downloads to get stuck. | ||||||
| 
 | 
 | ||||||
| ### 3.0.5 | ### 3.3.1 | ||||||
| 
 | 
 | ||||||
| - Removed error handling by consuming actions/cache 3.0 toolkit, Now cache server error handling will be done by toolkit. ([PR](https://github.com/actions/cache/pull/834)) | - Reduced segment size to 128MB and segment timeout to 10 minutes to fail fast in case the cache download is stuck. | ||||||
| 
 | 
 | ||||||
| ### 3.0.6 | ### 3.3.0 | ||||||
| 
 | 
 | ||||||
| - Fixed [#809](https://github.com/actions/cache/issues/809) - zstd -d: no such file or directory error | - Added option to lookup cache without downloading it. | ||||||
| - Fixed [#833](https://github.com/actions/cache/issues/833) - cache doesn't work with github workspace directory |  | ||||||
| 
 | 
 | ||||||
| ### 3.0.7 | ### 3.2.6 | ||||||
| 
 | 
 | ||||||
| - Fixed [#810](https://github.com/actions/cache/issues/810) - download stuck issue. A new timeout is introduced in the download process to abort the download if it gets stuck and doesn't finish within an hour. | - Fix zstd not being used after zstd version upgrade to 1.5.4 on hosted runners. | ||||||
| 
 | 
 | ||||||
| ### 3.0.8 | ### 3.2.5 | ||||||
| 
 | 
 | ||||||
| - Fix zstd not working for windows on gnu tar in issues [#888](https://github.com/actions/cache/issues/888) and [#891](https://github.com/actions/cache/issues/891). | - Added fix to prevent from setting MYSYS environment variable globally. | ||||||
| - Allowing users to provide a custom timeout as input for aborting download of a cache segment using an environment variable `SEGMENT_DOWNLOAD_TIMEOUT_MINS`. Default is 60 minutes. |  | ||||||
| 
 | 
 | ||||||
| ### 3.0.9 | ### 3.2.4 | ||||||
| 
 | 
 | ||||||
| - Enhanced the warning message for cache unavailablity in case of GHES. | - Added option to fail job on cache miss. | ||||||
| 
 | 
 | ||||||
| ### 3.0.10 | ### 3.2.3 | ||||||
| 
 | 
 | ||||||
| - Fix a bug with sorting inputs. | - Support cross os caching on Windows as an opt-in feature. | ||||||
| - Update definition for restore-keys in README.md | - Fix issue with symlink restoration on Windows for cross-os caches. | ||||||
| 
 | 
 | ||||||
| ### 3.0.11 | ### 3.2.2 | ||||||
| 
 | 
 | ||||||
| - Update toolkit version to 3.0.5 to include `@actions/core@^1.10.0` | - Reverted the changes made in 3.2.1 to use gnu tar and zstd by default on windows. | ||||||
| - Update `@actions/cache` to use updated `saveState` and `setOutput` functions from `@actions/core@^1.10.0` |  | ||||||
| 
 |  | ||||||
| ### 3.1.0-beta.1 |  | ||||||
| 
 |  | ||||||
| - Update `@actions/cache` on windows to use gnu tar and zstd by default and fallback to bsdtar and zstd if gnu tar is not available. ([issue](https://github.com/actions/cache/issues/984)) |  | ||||||
| 
 |  | ||||||
| ### 3.1.0-beta.2 |  | ||||||
| 
 |  | ||||||
| - Added support for fallback to gzip to restore old caches on windows. |  | ||||||
| 
 |  | ||||||
| ### 3.1.0-beta.3 |  | ||||||
| 
 |  | ||||||
| - Bug fixes for bsdtar fallback if gnutar not available and gzip fallback if cache saved using old cache action on windows. |  | ||||||
| 
 |  | ||||||
| ### 3.2.0-beta.1 |  | ||||||
| 
 |  | ||||||
| - Added two new actions - [restore](restore/action.yml) and [save](save/action.yml) for granular control on cache. |  | ||||||
| 
 |  | ||||||
| ### 3.2.0 |  | ||||||
| 
 |  | ||||||
| - Released the two new actions - [restore](restore/action.yml) and [save](save/action.yml) for granular control on cache |  | ||||||
| 
 | 
 | ||||||
| ### 3.2.1 | ### 3.2.1 | ||||||
| 
 | 
 | ||||||
|  | @ -79,44 +56,75 @@ | ||||||
| - Added support for fallback to gzip to restore old caches on windows. | - Added support for fallback to gzip to restore old caches on windows. | ||||||
| - Added logs for cache version in case of a cache miss. | - Added logs for cache version in case of a cache miss. | ||||||
| 
 | 
 | ||||||
| ### 3.2.2 | ### 3.2.0 | ||||||
| 
 | 
 | ||||||
| - Reverted the changes made in 3.2.1 to use gnu tar and zstd by default on windows. | - Released the two new actions - [restore](restore/action.yml) and [save](save/action.yml) for granular control on cache | ||||||
| 
 | 
 | ||||||
| ### 3.2.3 | ### 3.2.0-beta.1 | ||||||
| 
 | 
 | ||||||
| - Support cross os caching on Windows as an opt-in feature. | - Added two new actions - [restore](restore/action.yml) and [save](save/action.yml) for granular control on cache. | ||||||
| - Fix issue with symlink restoration on Windows for cross-os caches. |  | ||||||
| 
 | 
 | ||||||
| ### 3.2.4 | ### 3.1.0-beta.3 | ||||||
| 
 | 
 | ||||||
| - Added option to fail job on cache miss. | - Bug fixes for bsdtar fallback if gnutar not available and gzip fallback if cache saved using old cache action on windows. | ||||||
| 
 | 
 | ||||||
| ### 3.2.5 | ### 3.1.0-beta.2 | ||||||
| 
 | 
 | ||||||
| - Added fix to prevent from setting MYSYS environment variable globally. | - Added support for fallback to gzip to restore old caches on windows. | ||||||
| 
 | 
 | ||||||
| ### 3.2.6 | ### 3.1.0-beta.1 | ||||||
| 
 | 
 | ||||||
| - Fix zstd not being used after zstd version upgrade to 1.5.4 on hosted runners. | - Update `@actions/cache` on windows to use gnu tar and zstd by default and fallback to bsdtar and zstd if gnu tar is not available. ([issue](https://github.com/actions/cache/issues/984)) | ||||||
| 
 | 
 | ||||||
| ### 3.3.0 | ### 3.0.11 | ||||||
| 
 | 
 | ||||||
| - Added option to lookup cache without downloading it. | - Update toolkit version to 3.0.5 to include `@actions/core@^1.10.0` | ||||||
|  | - Update `@actions/cache` to use updated `saveState` and `setOutput` functions from `@actions/core@^1.10.0` | ||||||
| 
 | 
 | ||||||
| ### 3.3.1 | ### 3.0.10 | ||||||
| 
 | 
 | ||||||
| - Reduced segment size to 128MB and segment timeout to 10 minutes to fail fast in case the cache download is stuck. | - Fix a bug with sorting inputs. | ||||||
|  | - Update definition for restore-keys in README.md | ||||||
| 
 | 
 | ||||||
| ### 3.3.2 | ### 3.0.9 | ||||||
| 
 | 
 | ||||||
| - Fixes bug with Azure SDK causing blob downloads to get stuck. | - Enhanced the warning message for cache unavailablity in case of GHES. | ||||||
| 
 | 
 | ||||||
| ### 3.3.3 | ### 3.0.8 | ||||||
| 
 | 
 | ||||||
| - Updates @actions/cache to v3.2.3 to fix accidental mutated path arguments to `getCacheVersion` [actions/toolkit#1378](https://github.com/actions/toolkit/pull/1378) | - Fix zstd not working for windows on gnu tar in issues [#888](https://github.com/actions/cache/issues/888) and [#891](https://github.com/actions/cache/issues/891). | ||||||
| - Additional audit fixes of npm package(s) | - Allowing users to provide a custom timeout as input for aborting download of a cache segment using an environment variable `SEGMENT_DOWNLOAD_TIMEOUT_MINS`. Default is 60 minutes. | ||||||
| 
 | 
 | ||||||
| ### 4.0.0 | ### 3.0.7 | ||||||
| 
 | 
 | ||||||
| - Updated minimum runner version support from node 12 -> node 20 | - Fixed [#810](https://github.com/actions/cache/issues/810) - download stuck issue. A new timeout is introduced in the download process to abort the download if it gets stuck and doesn't finish within an hour. | ||||||
|  | 
 | ||||||
|  | ### 3.0.6 | ||||||
|  | 
 | ||||||
|  | - Fixed [#809](https://github.com/actions/cache/issues/809) - zstd -d: no such file or directory error | ||||||
|  | - Fixed [#833](https://github.com/actions/cache/issues/833) - cache doesn't work with github workspace directory | ||||||
|  | 
 | ||||||
|  | ### 3.0.5 | ||||||
|  | 
 | ||||||
|  | - Removed error handling by consuming actions/cache 3.0 toolkit, Now cache server error handling will be done by toolkit. ([PR](https://github.com/actions/cache/pull/834)) | ||||||
|  | 
 | ||||||
|  | ### 3.0.4 | ||||||
|  | 
 | ||||||
|  | - Fixed tar creation error while trying to create tar with path as `~/` home folder on `ubuntu-latest`. ([issue](https://github.com/actions/cache/issues/689)) | ||||||
|  | 
 | ||||||
|  | ### 3.0.3 | ||||||
|  | 
 | ||||||
|  | - Fixed avoiding empty cache save when no files are available for caching. ([issue](https://github.com/actions/cache/issues/624)) | ||||||
|  | 
 | ||||||
|  | ### 3.0.2 | ||||||
|  | 
 | ||||||
|  | - Added support for dynamic cache size cap on GHES. | ||||||
|  | 
 | ||||||
|  | ### 3.0.1 | ||||||
|  | 
 | ||||||
|  | - Added support for caching from GHES 3.5. | ||||||
|  | - Fixed download issue for files > 2GB during restore. | ||||||
|  | 
 | ||||||
|  | ### 3.0.0 | ||||||
|  | 
 | ||||||
|  | - Updated minimum runner version support from node 12 -> node 16 | ||||||
|  |  | ||||||
|  | @ -449,3 +449,19 @@ test("restore with lookup-only set", async () => { | ||||||
|     ); |     ); | ||||||
|     expect(failedMock).toHaveBeenCalledTimes(0); |     expect(failedMock).toHaveBeenCalledTimes(0); | ||||||
| }); | }); | ||||||
|  | 
 | ||||||
|  | test("restore failure with earlyExit should call process exit", async () => { | ||||||
|  |     testUtils.setInput(Inputs.Path, "node_modules"); | ||||||
|  |     const failedMock = jest.spyOn(core, "setFailed"); | ||||||
|  |     const restoreCacheMock = jest.spyOn(cache, "restoreCache"); | ||||||
|  |     const processExitMock = jest.spyOn(process, "exit").mockImplementation(); | ||||||
|  | 
 | ||||||
|  |     // call restoreImpl with `earlyExit` set to true
 | ||||||
|  |     await restoreImpl(new StateProvider(), true); | ||||||
|  | 
 | ||||||
|  |     expect(restoreCacheMock).toHaveBeenCalledTimes(0); | ||||||
|  |     expect(failedMock).toHaveBeenCalledWith( | ||||||
|  |         "Input required and not supplied: key" | ||||||
|  |     ); | ||||||
|  |     expect(processExitMock).toHaveBeenCalledWith(1); | ||||||
|  | }); | ||||||
|  |  | ||||||
							
								
								
									
										17
									
								
								dist/restore-only/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										17
									
								
								dist/restore-only/index.js
									
									
									
									
										vendored
									
									
								
							|  | @ -93775,7 +93775,7 @@ const lib_storage_1 = __nccwpck_require__(3087); | ||||||
| const downloadUtils_1 = __nccwpck_require__(6968); | const downloadUtils_1 = __nccwpck_require__(6968); | ||||||
| // if executing from RunsOn, unset any existing AWS env variables so that we can use the IAM instance profile for credentials
 | // if executing from RunsOn, unset any existing AWS env variables so that we can use the IAM instance profile for credentials
 | ||||||
| // see unsetCredentials() in https://github.com/aws-actions/configure-aws-credentials/blob/v4.0.2/src/helpers.ts#L44
 | // see unsetCredentials() in https://github.com/aws-actions/configure-aws-credentials/blob/v4.0.2/src/helpers.ts#L44
 | ||||||
| if (process.env.RUNS_ON_RUNNER_NAME) { | if (process.env.RUNS_ON_RUNNER_NAME && process.env.RUNS_ON_RUNNER_NAME !== "") { | ||||||
|     delete process.env.AWS_ACCESS_KEY_ID; |     delete process.env.AWS_ACCESS_KEY_ID; | ||||||
|     delete process.env.AWS_SECRET_ACCESS_KEY; |     delete process.env.AWS_SECRET_ACCESS_KEY; | ||||||
|     delete process.env.AWS_SESSION_TOKEN; |     delete process.env.AWS_SESSION_TOKEN; | ||||||
|  | @ -94464,7 +94464,7 @@ const stateProvider_1 = __nccwpck_require__(1527); | ||||||
| const utils = __importStar(__nccwpck_require__(6850)); | const utils = __importStar(__nccwpck_require__(6850)); | ||||||
| const custom = __importStar(__nccwpck_require__(1082)); | const custom = __importStar(__nccwpck_require__(1082)); | ||||||
| const canSaveToS3 = process.env["RUNS_ON_S3_BUCKET_CACHE"] !== undefined; | const canSaveToS3 = process.env["RUNS_ON_S3_BUCKET_CACHE"] !== undefined; | ||||||
| function restoreImpl(stateProvider) { | function restoreImpl(stateProvider, earlyExit) { | ||||||
|     return __awaiter(this, void 0, void 0, function* () { |     return __awaiter(this, void 0, void 0, function* () { | ||||||
|         try { |         try { | ||||||
|             if (!utils.isCacheFeatureAvailable()) { |             if (!utils.isCacheFeatureAvailable()) { | ||||||
|  | @ -94517,21 +94517,16 @@ function restoreImpl(stateProvider) { | ||||||
|         } |         } | ||||||
|         catch (error) { |         catch (error) { | ||||||
|             core.setFailed(error.message); |             core.setFailed(error.message); | ||||||
|  |             if (earlyExit) { | ||||||
|  |                 process.exit(1); | ||||||
|  |             } | ||||||
|         } |         } | ||||||
|     }); |     }); | ||||||
| } | } | ||||||
| exports.restoreImpl = restoreImpl; | exports.restoreImpl = restoreImpl; | ||||||
| function run(stateProvider, earlyExit) { | function run(stateProvider, earlyExit) { | ||||||
|     return __awaiter(this, void 0, void 0, function* () { |     return __awaiter(this, void 0, void 0, function* () { | ||||||
|         try { |         yield restoreImpl(stateProvider, earlyExit); | ||||||
|             yield restoreImpl(stateProvider); |  | ||||||
|         } |  | ||||||
|         catch (err) { |  | ||||||
|             console.error(err); |  | ||||||
|             if (earlyExit) { |  | ||||||
|                 process.exit(1); |  | ||||||
|             } |  | ||||||
|         } |  | ||||||
|         // node will stay alive if any promises are not resolved,
 |         // node will stay alive if any promises are not resolved,
 | ||||||
|         // which is a possibility if HTTP requests are dangling
 |         // which is a possibility if HTTP requests are dangling
 | ||||||
|         // due to retries or timeouts. We know that if we got here
 |         // due to retries or timeouts. We know that if we got here
 | ||||||
|  |  | ||||||
							
								
								
									
										15
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										15
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							|  | @ -94464,7 +94464,7 @@ const stateProvider_1 = __nccwpck_require__(1527); | ||||||
| const utils = __importStar(__nccwpck_require__(6850)); | const utils = __importStar(__nccwpck_require__(6850)); | ||||||
| const custom = __importStar(__nccwpck_require__(1082)); | const custom = __importStar(__nccwpck_require__(1082)); | ||||||
| const canSaveToS3 = process.env["RUNS_ON_S3_BUCKET_CACHE"] !== undefined; | const canSaveToS3 = process.env["RUNS_ON_S3_BUCKET_CACHE"] !== undefined; | ||||||
| function restoreImpl(stateProvider) { | function restoreImpl(stateProvider, earlyExit) { | ||||||
|     return __awaiter(this, void 0, void 0, function* () { |     return __awaiter(this, void 0, void 0, function* () { | ||||||
|         try { |         try { | ||||||
|             if (!utils.isCacheFeatureAvailable()) { |             if (!utils.isCacheFeatureAvailable()) { | ||||||
|  | @ -94517,21 +94517,16 @@ function restoreImpl(stateProvider) { | ||||||
|         } |         } | ||||||
|         catch (error) { |         catch (error) { | ||||||
|             core.setFailed(error.message); |             core.setFailed(error.message); | ||||||
|  |             if (earlyExit) { | ||||||
|  |                 process.exit(1); | ||||||
|  |             } | ||||||
|         } |         } | ||||||
|     }); |     }); | ||||||
| } | } | ||||||
| exports.restoreImpl = restoreImpl; | exports.restoreImpl = restoreImpl; | ||||||
| function run(stateProvider, earlyExit) { | function run(stateProvider, earlyExit) { | ||||||
|     return __awaiter(this, void 0, void 0, function* () { |     return __awaiter(this, void 0, void 0, function* () { | ||||||
|         try { |         yield restoreImpl(stateProvider, earlyExit); | ||||||
|             yield restoreImpl(stateProvider); |  | ||||||
|         } |  | ||||||
|         catch (err) { |  | ||||||
|             console.error(err); |  | ||||||
|             if (earlyExit) { |  | ||||||
|                 process.exit(1); |  | ||||||
|             } |  | ||||||
|         } |  | ||||||
|         // node will stay alive if any promises are not resolved,
 |         // node will stay alive if any promises are not resolved,
 | ||||||
|         // which is a possibility if HTTP requests are dangling
 |         // which is a possibility if HTTP requests are dangling
 | ||||||
|         // due to retries or timeouts. We know that if we got here
 |         // due to retries or timeouts. We know that if we got here
 | ||||||
|  |  | ||||||
							
								
								
									
										2
									
								
								dist/save-only/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/save-only/index.js
									
									
									
									
										vendored
									
									
								
							|  | @ -93775,7 +93775,7 @@ const lib_storage_1 = __nccwpck_require__(3087); | ||||||
| const downloadUtils_1 = __nccwpck_require__(6968); | const downloadUtils_1 = __nccwpck_require__(6968); | ||||||
| // if executing from RunsOn, unset any existing AWS env variables so that we can use the IAM instance profile for credentials
 | // if executing from RunsOn, unset any existing AWS env variables so that we can use the IAM instance profile for credentials
 | ||||||
| // see unsetCredentials() in https://github.com/aws-actions/configure-aws-credentials/blob/v4.0.2/src/helpers.ts#L44
 | // see unsetCredentials() in https://github.com/aws-actions/configure-aws-credentials/blob/v4.0.2/src/helpers.ts#L44
 | ||||||
| if (process.env.RUNS_ON_RUNNER_NAME) { | if (process.env.RUNS_ON_RUNNER_NAME && process.env.RUNS_ON_RUNNER_NAME !== "") { | ||||||
|     delete process.env.AWS_ACCESS_KEY_ID; |     delete process.env.AWS_ACCESS_KEY_ID; | ||||||
|     delete process.env.AWS_SECRET_ACCESS_KEY; |     delete process.env.AWS_SECRET_ACCESS_KEY; | ||||||
|     delete process.env.AWS_SESSION_TOKEN; |     delete process.env.AWS_SESSION_TOKEN; | ||||||
|  |  | ||||||
							
								
								
									
										4
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										4
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							|  | @ -1,12 +1,12 @@ | ||||||
| { | { | ||||||
|   "name": "cache", |   "name": "cache", | ||||||
|   "version": "4.0.0", |   "version": "4.0.2", | ||||||
|   "lockfileVersion": 2, |   "lockfileVersion": 2, | ||||||
|   "requires": true, |   "requires": true, | ||||||
|   "packages": { |   "packages": { | ||||||
|     "": { |     "": { | ||||||
|       "name": "cache", |       "name": "cache", | ||||||
|       "version": "4.0.0", |       "version": "4.0.2", | ||||||
|       "license": "MIT", |       "license": "MIT", | ||||||
|       "dependencies": { |       "dependencies": { | ||||||
|         "@actions/cache": "^3.2.4", |         "@actions/cache": "^3.2.4", | ||||||
|  |  | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| { | { | ||||||
|   "name": "cache", |   "name": "cache", | ||||||
|   "version": "4.0.0", |   "version": "4.0.2", | ||||||
|   "private": true, |   "private": true, | ||||||
|   "description": "Cache dependencies and build outputs", |   "description": "Cache dependencies and build outputs", | ||||||
|   "main": "dist/restore/index.js", |   "main": "dist/restore/index.js", | ||||||
|  |  | ||||||
|  | @ -13,7 +13,8 @@ import * as custom from "./custom/cache"; | ||||||
| const canSaveToS3 = process.env["RUNS_ON_S3_BUCKET_CACHE"] !== undefined; | const canSaveToS3 = process.env["RUNS_ON_S3_BUCKET_CACHE"] !== undefined; | ||||||
| 
 | 
 | ||||||
| export async function restoreImpl( | export async function restoreImpl( | ||||||
|     stateProvider: IStateProvider |     stateProvider: IStateProvider, | ||||||
|  |     earlyExit?: boolean | undefined | ||||||
| ): Promise<string | undefined> { | ): Promise<string | undefined> { | ||||||
|     try { |     try { | ||||||
|         if (!utils.isCacheFeatureAvailable()) { |         if (!utils.isCacheFeatureAvailable()) { | ||||||
|  | @ -100,6 +101,9 @@ export async function restoreImpl( | ||||||
|         return cacheKey; |         return cacheKey; | ||||||
|     } catch (error: unknown) { |     } catch (error: unknown) { | ||||||
|         core.setFailed((error as Error).message); |         core.setFailed((error as Error).message); | ||||||
|  |         if (earlyExit) { | ||||||
|  |             process.exit(1); | ||||||
|  |         } | ||||||
|     } |     } | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | @ -107,14 +111,7 @@ async function run( | ||||||
|     stateProvider: IStateProvider, |     stateProvider: IStateProvider, | ||||||
|     earlyExit: boolean | undefined |     earlyExit: boolean | undefined | ||||||
| ): Promise<void> { | ): Promise<void> { | ||||||
|     try { |     await restoreImpl(stateProvider, earlyExit); | ||||||
|         await restoreImpl(stateProvider); |  | ||||||
|     } catch (err) { |  | ||||||
|         console.error(err); |  | ||||||
|         if (earlyExit) { |  | ||||||
|             process.exit(1); |  | ||||||
|         } |  | ||||||
|     } |  | ||||||
| 
 | 
 | ||||||
|     // node will stay alive if any promises are not resolved,
 |     // node will stay alive if any promises are not resolved,
 | ||||||
|     // which is a possibility if HTTP requests are dangling
 |     // which is a possibility if HTTP requests are dangling
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Cyril Rohr
						Cyril Rohr