aboutsummaryrefslogtreecommitdiff
path: root/modules/github
diff options
context:
space:
mode:
authorGravatar jesopo2019-03-01 21:20:19 +0000
committerGravatar jesopo2019-03-01 21:20:19 +0000
commit88a28352b805854ea117d9e8c145cbf9d9d26401 (patch)
treeda99bf165b32a632b7afc784bee41a4c82ced718 /modules/github
parentCapitalise 'PR' in issue_comment events for pull requests (github) (diff)
signature
Add a setting to hide github repo names
Diffstat (limited to 'modules/github')
-rw-r--r--modules/github/__init__.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/modules/github/__init__.py b/modules/github/__init__.py
index a4751640..6c766ca5 100644
--- a/modules/github/__init__.py
+++ b/modules/github/__init__.py
@@ -83,6 +83,9 @@ CHECK_RUN_FAILURES = ["failure", "cancelled", "timed_out", "action_required"]
@utils.export("channelset", {"setting": "github-hide-prefix",
"help": "Hide/show command-like prefix on Github hook outputs",
"validate": utils.bool_or_none})
+@utils.export("channelset", {"setting": "github-hide-organisation",
+ "help": "Hide/show organisation in repository names",
+ "validate": utils.bool_or_none})
@utils.export("channelset", {"setting": "github-default-repo",
"help": "Set the default github repo for the current channel"})
@utils.export("channelset", {"setting": "github-prevent-highlight",
@@ -365,10 +368,15 @@ class Module(ModuleManager.BaseModule):
elif github_event == "watch":
outputs = self.watch(data)
+ source = full_name or organisation
+ hide_org = event["channel"].get_setting("github-hide-organisation",
+ False)
+ if repo_name and hide_org:
+ source = repo_name
+
if outputs:
for server, channel in targets:
for output in outputs:
- source = full_name or organisation
output = "(%s) %s" % (
utils.irc.color(source, COLOR_REPO), output)