Skip to content

Commit 0e6395e

Browse files
authored
Avoid an error when dealing with failed deployments (#23)
Fixes #21.
1 parent 7e84e00 commit 0e6395e

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

create-deployment.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,5 @@ exports.createDeployment = async function(applicationName, fullRepositoryName, b
161161
console.log('🥳 Deployment successful');
162162
} catch (e) {
163163
core.setFailed(`😱 The deployment ${deploymentId} seems to have failed.`);
164-
throw e;
165164
}
166165
}

dist/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ exports.createDeployment = async function(applicationName, fullRepositoryName, b
177177
console.log('🥳 Deployment successful');
178178
} catch (e) {
179179
core.setFailed(`😱 The deployment ${deploymentId} seems to have failed.`);
180-
throw e;
181180
}
182181
}
183182

@@ -211,8 +210,11 @@ exports.createDeployment = async function(applicationName, fullRepositoryName, b
211210
const runNumber = process.env['github_run_number'] || process.env['GITHUB_RUN_NUMBER'];
212211

213212
try {
214-
action.createDeployment(applicationName, fullRepositoryName, branchName, configLookupName, commitId, runNumber, skipSequenceCheck, core);
215-
} catch (e) {}
213+
await action.createDeployment(applicationName, fullRepositoryName, branchName, configLookupName, commitId, runNumber, skipSequenceCheck, core);
214+
} catch (e) {
215+
console.log(`👉🏻 ${e.message}`);
216+
process.exit(1);
217+
}
216218
})();
217219

218220

index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
const runNumber = process.env['github_run_number'] || process.env['GITHUB_RUN_NUMBER'];
2222

2323
try {
24-
action.createDeployment(applicationName, fullRepositoryName, branchName, configLookupName, commitId, runNumber, skipSequenceCheck, core);
25-
} catch (e) {}
24+
await action.createDeployment(applicationName, fullRepositoryName, branchName, configLookupName, commitId, runNumber, skipSequenceCheck, core);
25+
} catch (e) {
26+
console.log(`👉🏻 ${e.message}`);
27+
process.exit(1);
28+
}
2629
})();

0 commit comments

Comments
 (0)