diff options
| author | 2019-09-04 11:15:36 +0100 | |
|---|---|---|
| committer | 2019-09-04 11:15:59 +0100 | |
| commit | 786117b998a6e0905491f2e6c6f1be32370145d3 (patch) | |
| tree | 2e6e21d7057d124d27a7a818c9ee337a19e4056f /modules/git_webhooks/__init__.py | |
| parent | Force 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/__init__.py')
| -rw-r--r-- | modules/git_webhooks/__init__.py | 5 |
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( |
