Add webhook bearer token support
Docker / build (push) Canceled after 0s

This commit is contained in:
2026-09-02 15:17:05 +02:00
parent c1961093d6
commit 93f7d78c27
5 changed files with 14 additions and 2 deletions
+9 -2
View File
@@ -2,7 +2,14 @@ const axios = require('axios');
const config = require('../config');
function sendToWebhook(data) {
return axios.post(config.WEBHOOK_URL, data, { timeout: 5000 });
const headers = config.WEBHOOK_BEARER_TOKEN
? { Authorization: `Bearer ${config.WEBHOOK_BEARER_TOKEN}` }
: undefined;
return axios.post(config.WEBHOOK_URL, data, {
timeout: 5000,
headers
});
}
module.exports = { sendToWebhook };
module.exports = { sendToWebhook };