Skip to content

Commit a829989

Browse files
Merge pull request #1 from YonatanGreenfeld/hotfix-no-stack-raises-error
Add try-catch to getCurrentDeployedCommit
2 parents f516186 + 500278a commit a829989

File tree

3 files changed

+8
-32
lines changed

3 files changed

+8
-32
lines changed

.github/workflows/commitlint.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "serverless-git-version-compare",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"main": "src/plugin.js",
55
"scripts": {
66
"test": "jest tests/",

src/plugin.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,13 @@ class GitVersionComparePlugin {
9696
* @returns {Promise<string|null>}
9797
*/
9898
async getDeployedCommit() {
99-
const stackName = this.provider.naming.getStackName();
100-
return await this.getCurrentDeployedCommit(stackName);
99+
try {
100+
const stackName = this.provider.naming.getStackName();
101+
return await this.getCurrentDeployedCommit(stackName);
102+
} catch (error) {
103+
this.log.error(`Error getting stack name: ${error}`);
104+
return null;
105+
}
101106
}
102107

103108
/**

0 commit comments

Comments
 (0)