Feat: Send NTFY_TOKEN with alerts so the ntfy topic can be private

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-20 18:04:00 +00:00
co-authored by Claude Opus 5.5
parent 3a36dae5d0
commit 2188ae1964
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -344,7 +344,7 @@ async function notify(env,{ title, message, tags, priority }) {
if (!env.NTFY_URL) return;
const endpoint = env.NTFY_URL.startsWith("http") ? env.NTFY_URL : `https://${env.NTFY_URL}`;
try {
await fetch(endpoint, { method: "POST", body: message, headers: { "Title": title, "Tags": tags, "Priority": priority.toString() } });
await fetch(endpoint, { method: "POST", body: message, headers: { "Title": title, "Tags": tags, "Priority": priority.toString(), ...(env.NTFY_TOKEN && { "Authorization": `Bearer ${env.NTFY_TOKEN}` }) } });
} catch {}
}