Skip cleanup if provider undefined

pull/419/head
Frostebite 2022-08-28 23:22:28 +01:00
parent 01dd075646
commit 657cdfb78f
3 changed files with 12 additions and 8 deletions

2
dist/index.js vendored
View File

@ -927,7 +927,9 @@ class CloudRunnerError {
return __awaiter(this, void 0, void 0, function* () {
cloud_runner_logger_1.default.error(JSON.stringify(error, undefined, 4));
core.setFailed('Cloud Runner failed');
if (cloud_runner_1.default.Provider !== undefined) {
yield cloud_runner_1.default.Provider.cleanup(cloud_runner_1.default.buildParameters.buildGuid, cloud_runner_1.default.buildParameters, cloud_runner_1.default.buildParameters.branch, cloud_runner_1.default.defaultSecrets);
}
});
}
}

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -6,6 +6,7 @@ export class CloudRunnerError {
public static async handleException(error: unknown) {
CloudRunnerLogger.error(JSON.stringify(error, undefined, 4));
core.setFailed('Cloud Runner failed');
if (CloudRunner.Provider !== undefined) {
await CloudRunner.Provider.cleanup(
CloudRunner.buildParameters.buildGuid,
CloudRunner.buildParameters,
@ -14,3 +15,4 @@ export class CloudRunnerError {
);
}
}
}