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
This commit is contained in:
Eric
2026-02-16 15:07:30 -06:00
committed by GitHub
parent 988f0bbcc6
commit baada0741f
+6 -1
View File
@@ -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) {