Skip to content

Commit 478b9ea

Browse files
committed
handling missing creds
1 parent 3639681 commit 478b9ea

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

.github/workflows/nodejs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Integration Tests
22

33
on:
4-
pull_request:
4+
push:
55
branches: [ master ]
66

77
jobs:

serverless.component.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: aws-lambda-layer
2-
version: 0.0.3
2+
version: 0.0.4
33
author: ac360
44
org: serverlessinc
55
description: Deploys an AWS Lambda Layer

src/utils.js

+6
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ const sleep = async (wait) => new Promise((resolve) => setTimeout(() => resolve(
1414
* @param ${string} region - aws region
1515
*/
1616
const getClients = (credentials, region = 'us-east-1') => {
17+
// this error message assumes that the user is running via the CLI though...
18+
if (Object.keys(credentials).length === 0) {
19+
const msg = `Credentials not found. Make sure you have a .env file in the cwd. - Docs: https://git.io/JvArp`
20+
throw new Error(msg)
21+
}
22+
1723
AWS.config.update({
1824
httpOptions: {
1925
agent

0 commit comments

Comments
 (0)