File tree Expand file tree Collapse file tree 3 files changed +16
-29
lines changed
Expand file tree Collapse file tree 3 files changed +16
-29
lines changed Original file line number Diff line number Diff line change @@ -59392,7 +59392,7 @@ const core = __importStar(__nccwpck_require__(2186));
5939259392const constants_1 = __nccwpck_require__(9042);
5939359393const stateProvider_1 = __nccwpck_require__(1527);
5939459394const utils = __importStar(__nccwpck_require__(6850));
59395- function restoreImpl(stateProvider) {
59395+ function restoreImpl(stateProvider, earlyExit ) {
5939659396 return __awaiter(this, void 0, void 0, function* () {
5939759397 try {
5939859398 if (!utils.isCacheFeatureAvailable()) {
@@ -59438,21 +59438,16 @@ function restoreImpl(stateProvider) {
5943859438 }
5943959439 catch (error) {
5944059440 core.setFailed(error.message);
59441+ if (earlyExit) {
59442+ process.exit(1);
59443+ }
5944159444 }
5944259445 });
5944359446}
5944459447exports.restoreImpl = restoreImpl;
5944559448function run(stateProvider, earlyExit) {
5944659449 return __awaiter(this, void 0, void 0, function* () {
59447- try {
59448- yield restoreImpl(stateProvider);
59449- }
59450- catch (err) {
59451- console.error(err);
59452- if (earlyExit) {
59453- process.exit(1);
59454- }
59455- }
59450+ yield restoreImpl(stateProvider, earlyExit);
5945659451 // node will stay alive if any promises are not resolved,
5945759452 // which is a possibility if HTTP requests are dangling
5945859453 // due to retries or timeouts. We know that if we got here
Original file line number Diff line number Diff line change @@ -59392,7 +59392,7 @@ const core = __importStar(__nccwpck_require__(2186));
5939259392const constants_1 = __nccwpck_require__(9042);
5939359393const stateProvider_1 = __nccwpck_require__(1527);
5939459394const utils = __importStar(__nccwpck_require__(6850));
59395- function restoreImpl(stateProvider) {
59395+ function restoreImpl(stateProvider, earlyExit ) {
5939659396 return __awaiter(this, void 0, void 0, function* () {
5939759397 try {
5939859398 if (!utils.isCacheFeatureAvailable()) {
@@ -59438,21 +59438,16 @@ function restoreImpl(stateProvider) {
5943859438 }
5943959439 catch (error) {
5944059440 core.setFailed(error.message);
59441+ if (earlyExit) {
59442+ process.exit(1);
59443+ }
5944159444 }
5944259445 });
5944359446}
5944459447exports.restoreImpl = restoreImpl;
5944559448function run(stateProvider, earlyExit) {
5944659449 return __awaiter(this, void 0, void 0, function* () {
59447- try {
59448- yield restoreImpl(stateProvider);
59449- }
59450- catch (err) {
59451- console.error(err);
59452- if (earlyExit) {
59453- process.exit(1);
59454- }
59455- }
59450+ yield restoreImpl(stateProvider, earlyExit);
5945659451 // node will stay alive if any promises are not resolved,
5945759452 // which is a possibility if HTTP requests are dangling
5945859453 // due to retries or timeouts. We know that if we got here
Original file line number Diff line number Diff line change @@ -10,7 +10,8 @@ import {
1010import * as utils from "./utils/actionUtils" ;
1111
1212export async function restoreImpl (
13- stateProvider : IStateProvider
13+ stateProvider : IStateProvider ,
14+ earlyExit ?: boolean | undefined
1415) : Promise < string | undefined > {
1516 try {
1617 if ( ! utils . isCacheFeatureAvailable ( ) ) {
@@ -83,21 +84,17 @@ export async function restoreImpl(
8384 return cacheKey ;
8485 } catch ( error : unknown ) {
8586 core . setFailed ( ( error as Error ) . message ) ;
87+ if ( earlyExit ) {
88+ process . exit ( 1 ) ;
89+ }
8690 }
8791}
8892
8993async function run (
9094 stateProvider : IStateProvider ,
9195 earlyExit : boolean | undefined
9296) : Promise < void > {
93- try {
94- await restoreImpl ( stateProvider ) ;
95- } catch ( err ) {
96- console . error ( err ) ;
97- if ( earlyExit ) {
98- process . exit ( 1 ) ;
99- }
100- }
97+ await restoreImpl ( stateProvider , earlyExit ) ;
10198
10299 // node will stay alive if any promises are not resolved,
103100 // which is a possibility if HTTP requests are dangling
You can’t perform that action at this time.
0 commit comments