Skip to content

Commit 66e5aa1

Browse files
author
Nick Hammond
committed
fix: Prevent deployment failure if deployment is skipped
Serverless won't deploy if the assets haven't changed, so won't compile the template to be uploaded. Signed-off-by: Nick Hammond <[email protected]>
1 parent d6af077 commit 66e5aa1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ class ServerlessPlugin {
6363
this.serverless.cli.log(chalk.green('Valid template'));
6464
return Promise.resolve();
6565
} catch (e) {
66+
if (e.message.toString().match(/Access Denied/i)) {
67+
// eslint-disable-next-line max-len
68+
this.serverless.cli.log(chalk.yellow('Unable to access template file. Likely due to Serverless skipping deployment. Check logs to confirm'));
69+
return Promise.resolve();
70+
}
6671
this.serverless.cli.log(chalk.red(`Template is invalid. Error: ${e}`));
6772
return Promise.reject(e);
6873
}

0 commit comments

Comments
 (0)