add a bot-wide setting to allow showing git webhook activity for private repos
closes #127
This commit is contained in:
parent
c4428e479f
commit
786117b998
1 changed files with 4 additions and 1 deletions
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue