commit c8eea46cc9ac2f483562bdad52e39be2eff14b07
parent de3b0fd6a064e52f69236c5d4b0fca24cc64f892
Author: Demonstrandum <moi@knutsen.co>
Date: Sun, 2 Aug 2020 13:58:45 +0100
Ignore non-master related GitHub webhooks.
Diffstat:
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/lib/main.ts b/lib/main.ts
@@ -181,7 +181,7 @@ export class SimpOMatic {
|| member.user.tag.split('#').first()));
}
});
-
+
// TODO: In web-server, check for correct secret.
// Send messages on web-hooks.
server(GLOBAL_CONFIG, body => {
@@ -214,6 +214,9 @@ export class SimpOMatic {
.setDescription(`“${pr.title}” (**#${pr.number}**)`
+ ` was ${body.action}.`);
}
+ } else if (body.ref) {
+ // Ignore this.
+ console.log("Non-master related git event.");
} else if (body.console === true) {
if (body.secret !== process.env["WEB_SECRET"]) {
return;
@@ -283,7 +286,7 @@ export class SimpOMatic {
&& CONFIG.whitelistchannels.length > 0
&& !CONFIG.whitelistchannels.includes(message.channel.id))
return;
-
+
console.log('[command] Whitelisted.');
const last_command = this._COMMAND_HISTORY.last();