Skip to content

Commit ab3045f

Browse files
fix: handle undefined monitor name in PagerDuty notification summary (#6977)
Co-authored-by: Maks Pikov <mixelburg@users.noreply.github.com> Co-authored-by: Frank Elsinga <frank@elsinga.de>
1 parent 02e082d commit ab3045f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

.github/workflows/npm-update.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: NPM Update
33
on:
44
workflow_dispatch:
55
schedule:
6-
- cron: "0 0 * * *" # Run daily at midnight UTC
6+
- cron: "0 0 * * *" # Run daily at midnight UTC
77

88
permissions:
99
contents: write

server/notification-providers/pagerduty.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,13 @@ class PagerDuty extends NotificationProvider {
8585
headers: { "Content-Type": "application/json" },
8686
data: {
8787
payload: {
88-
summary: `[${title}] [${monitorInfo.name}] ${body}`,
88+
summary: monitorInfo.name ? `[${title}] [${monitorInfo.name}] ${body}` : `[${title}] ${body}`,
8989
severity: notification.pagerdutyPriority || "warning",
9090
source: monitorUrl,
9191
},
9292
routing_key: notification.pagerdutyIntegrationKey,
9393
event_action: eventAction,
94-
dedup_key: "Uptime Kuma/" + monitorInfo.id,
94+
dedup_key: monitorInfo.id ? "Uptime Kuma/" + monitorInfo.id : "Uptime Kuma/test",
9595
},
9696
};
9797

0 commit comments

Comments
 (0)