aboutsummaryrefslogtreecommitdiff
path: root/modules/git_webhooks
diff options
context:
space:
mode:
authorGravatar jesopo2019-09-04 11:15:36 +0100
committerGravatar jesopo2019-09-04 11:15:59 +0100
commit786117b998a6e0905491f2e6c6f1be32370145d3 (patch)
tree2e6e21d7057d124d27a7a818c9ee337a19e4056f /modules/git_webhooks
parentForce removal of ":" from user_time.py API-provided ISO8601 (diff)
signature
add a bot-wide setting to allow showing git webhook activity for private repos
closes #127
Diffstat (limited to 'modules/git_webhooks')
-rw-r--r--modules/git_webhooks/__init__.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/git_webhooks/__init__.py b/modules/git_webhooks/__init__.py
index 4b3e31ad..bea2ea2c 100644
--- a/modules/git_webhooks/__init__.py
+++ b/modules/git_webhooks/__init__.py
@@ -19,6 +19,8 @@ DEFAULT_EVENT_CATEGORIES = [
"Hide/show organisation in repository names"))
@utils.export("channelset", utils.BoolSetting("git-hide-prefix",
"Hide/show command-like prefix on git webhook outputs"))
+@utils.export("botset", utils.BoolSetting("git-show-private",
+ "Whether or not to show git activity for private repositories"))
class Module(ModuleManager.BaseModule):
_name = "Webhooks"
@@ -44,7 +46,8 @@ class Module(ModuleManager.BaseModule):
"payload"][0])
data = json.loads(payload)
- if handler.is_private(data, headers):
+ if handler.is_private(data, headers) and not self.bot.get_setting(
+ "git-show-private", False):
return {"state": "success", "deliveries": 0}
full_name, repo_username, repo_name, organisation = handler.names(