From baada0741f74427dba6d3b05bdf069b423169b57 Mon Sep 17 00:00:00 2001 From: Eric Date: Mon, 16 Feb 2026 15:07:30 -0600 Subject: [PATCH] Website: Update GitHub webhook exits (#39940) Changes: - Added a new exit to the receive-from-github webhook that is used when a provided `botSignature` does not match the `githubBotWebhookSecret` config variable --- website/api/controllers/webhooks/receive-from-github.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/website/api/controllers/webhooks/receive-from-github.js b/website/api/controllers/webhooks/receive-from-github.js index c4e79986f6..95b98b27ac 100644 --- a/website/api/controllers/webhooks/receive-from-github.js +++ b/website/api/controllers/webhooks/receive-from-github.js @@ -25,6 +25,11 @@ module.exports = { projects_v2_item: { type: {} }, //eslint-disable-line camelcase }, + exits: { + success: {description: 'A GitHub event was successfully received.'}, + unexpectedBotSignature: {description: 'The provided botSignature was incorrect', responseType: 'unauthorized' }, + }, + fn: async function ({botSignature, action, sender, repository, changes, issue, comment, pull_request: pr, label, release, projects_v2_item: projectsV2Item}) { @@ -141,7 +146,7 @@ module.exports = { throw new Error('No GitHub bot webhook secret configured! (Please set `sails.config.custom.githubBotWebhookSecret`.)'); }//• if (sails.config.custom.githubBotWebhookSecret !== botSignature) { - throw new Error('Received unexpected GitHub webhook request with botSignature set to: '+botSignature); + throw 'unexpectedBotSignature'; }//• if (!sails.config.custom.githubAccessToken) {