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>
pull/6978/head^2
mixelburg 2 months ago committed by GitHub
parent 02e082d0a7
commit ab3045f80e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -3,7 +3,7 @@ name: NPM Update
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *" # Run daily at midnight UTC
- cron: "0 0 * * *" # Run daily at midnight UTC
permissions:
contents: write

@ -85,13 +85,13 @@ class PagerDuty extends NotificationProvider {
headers: { "Content-Type": "application/json" },
data: {
payload: {
summary: `[${title}] [${monitorInfo.name}] ${body}`,
summary: monitorInfo.name ? `[${title}] [${monitorInfo.name}] ${body}` : `[${title}] ${body}`,
severity: notification.pagerdutyPriority || "warning",
source: monitorUrl,
},
routing_key: notification.pagerdutyIntegrationKey,
event_action: eventAction,
dedup_key: "Uptime Kuma/" + monitorInfo.id,
dedup_key: monitorInfo.id ? "Uptime Kuma/" + monitorInfo.id : "Uptime Kuma/test",
},
};

Loading…
Cancel
Save