ci: Add version release notification workflow (#26897)

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Matsu
2026-03-11 16:30:19 +00:00
committed by GitHub
co-authored by Claude Sonnet 4.6
parent 5ab71b4ba6
commit 4e1e0cd1c0
3 changed files with 90 additions and 0 deletions
@@ -0,0 +1,32 @@
import { ensureEnvVar } from './github-helpers.mjs';
async function sendVersionReleaseNotification() {
const payload = ensureEnvVar('PAYLOAD');
const webhookData = ensureEnvVar('N8N_VERSION_RELEASE_NOTIFICATION_DATA');
const { user, secret, url } = JSON.parse(webhookData);
console.log('Payload: ', JSON.parse(payload));
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: 'Basic ' + Buffer.from(`${user}:${secret}`).toString('base64'),
},
body: payload,
});
const status = response.status;
console.log('Webhook call returned status ' + status);
if (status !== 200) {
const body = await response.text();
throw new Error(`Webhook call failed:\n\n ${body}`);
}
}
// only run when executed directly, not when imported by tests
if (import.meta.url === `file://${process.argv[1]}`) {
sendVersionReleaseNotification();
}