From 255a5d965c14bf27c547d3831b8527fa2d08e8bf Mon Sep 17 00:00:00 2001 From: Teddy Katz Date: Mon, 16 Oct 2017 20:16:17 -0400 Subject: [PATCH] Update: disable experimental plugins by default --- README.md | 8 ++++++-- src/app.js | 12 +++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 9e2f0b7..9d8f02a 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,10 @@ Plugins are the core part of the bot. They are standalone pieces which listen on _Note: All plugin names marked with `*` are experimental._ -#### How to disable a plugin +#### Adding plugins -Works need to be done in this area but for now just comment the plugin which you want to disable inside `src/plugins/index` file. +To add a plugin: + +1. Create the plugin as a new file in `src/plugins`. +1. Add the plugin to the list in `src/plugins/index.js`. +1. Add the plugin to the list `src/app.js` to enable it by default. diff --git a/src/app.js b/src/app.js index 7e8e39a..605a1d5 100644 --- a/src/app.js +++ b/src/app.js @@ -13,13 +13,15 @@ const bot = probot({ cert: process.env.PRIVATE_KEY || "", // required id: process.env.APP_ID || "" // required }); -const disabledPlugins = [ - "prReadyToMerge" -]; +const enabledPlugins = new Set([ + "commitMessage", + "needsInfo", + "triage" +]); -// load all the plugins from inside plugins folder except the one which are disabled +// load all the enabled plugins from inside plugins folder Object.keys(plugins) - .filter((pluginId) => !disabledPlugins.includes(pluginId)) + .filter((pluginId) => enabledPlugins.has(pluginId)) .forEach((pluginId) => bot.load(plugins[pluginId])); // start the server