Skip to content

Commit 255a5d9

Browse files
Update: disable experimental plugins by default
1 parent 995c1f2 commit 255a5d9

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

README.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ Plugins are the core part of the bot. They are standalone pieces which listen on
4646

4747
_Note: All plugin names marked with `*` are experimental._
4848

49-
#### How to disable a plugin
49+
#### Adding plugins
5050

51-
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.
51+
To add a plugin:
52+
53+
1. Create the plugin as a new file in `src/plugins`.
54+
1. Add the plugin to the list in `src/plugins/index.js`.
55+
1. Add the plugin to the list `src/app.js` to enable it by default.

src/app.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ const bot = probot({
1313
cert: process.env.PRIVATE_KEY || "", // required
1414
id: process.env.APP_ID || "" // required
1515
});
16-
const disabledPlugins = [
17-
"prReadyToMerge"
18-
];
16+
const enabledPlugins = new Set([
17+
"commitMessage",
18+
"needsInfo",
19+
"triage"
20+
]);
1921

20-
// load all the plugins from inside plugins folder except the one which are disabled
22+
// load all the enabled plugins from inside plugins folder
2123
Object.keys(plugins)
22-
.filter((pluginId) => !disabledPlugins.includes(pluginId))
24+
.filter((pluginId) => enabledPlugins.has(pluginId))
2325
.forEach((pluginId) => bot.load(plugins[pluginId]));
2426

2527
// start the server

0 commit comments

Comments
 (0)