Skip to content

Commit 8d40ab4

Browse files
committed
fix ci
1 parent 6384b4d commit 8d40ab4

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
env:
15-
TERRAFORM_VERSION: 0.13.5
15+
TERRAFORM_VERSION: 1.4.0
1616
TERRAFORM_WORK_DIR: ./terraform
1717

1818
steps:

lambda/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
import { Handler } from "aws-lambda";
22
import axios from 'axios';
33
import { Payload, Text } from "./types";
4+
import { error } from "console";
45

56
const handler: Handler = async (payload: Payload) => {
67
const apiKey = process.env.API_Key;
78
const apiUrl = process.env.API_URL;
89
const { headers, data } = payload;
910

1011
try {
12+
if (!apiUrl)
13+
{
14+
throw error;
15+
}
1116
// Make the HTTP request using Axios
1217
const response = await axios.post(apiUrl, data, {
1318
headers: headers,

test/mocks/index.ts

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,22 @@
1-
import "./libs/aws-sdk";
1+
export const PAYLOAD = {
2+
headers: [
3+
4+
],
5+
data: {
6+
"message": "An example alert message",
7+
"alias": "Life is too short for no alias",
8+
"description":"Every alert needs a description",
9+
"responders":[
10+
{"id":"4513b7ea-3b91-438f-b7e4-e3e54af9147c", "type":"team"},
11+
],
12+
"visibleTo":[
13+
{"id":"4513b7ea-3b91-438f-b7e4-e3e54af9147c","type":"team"},
14+
],
15+
"actions": ["Restart", "AnExampleAction"],
16+
"tags": ["OverwriteQuietHours","Critical"],
17+
"details":{"key1":"value1","key2":"value2"},
18+
"entity":"An example entity",
19+
"priority":"P1"
20+
}
21+
}
22+

0 commit comments

Comments
 (0)