aboutsummaryrefslogtreecommitdiff
path: root/modules/git_webhooks
diff options
context:
space:
mode:
authorGravatar jesopo2019-10-25 22:36:27 +0100
committerGravatar jesopo2019-10-25 22:37:03 +0100
commitf92f2c9cc14721029a75ded58db21fcfe41c1e81 (patch)
treee6f08fd2e10e9ce80ab28c5e2a6e2618f821c826 /modules/git_webhooks
parentsupport gitlab subgroups in git_webhooks (diff)
signature
make `repo_username` the subgroup when present
Diffstat (limited to 'modules/git_webhooks')
-rw-r--r--modules/git_webhooks/gitlab.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/git_webhooks/gitlab.py b/modules/git_webhooks/gitlab.py
index 56cd968c..e9b1c41b 100644
--- a/modules/git_webhooks/gitlab.py
+++ b/modules/git_webhooks/gitlab.py
@@ -54,7 +54,12 @@ class GitLab(object):
full_name = data["project"]["path_with_namespace"]
repo_username, repo_name = full_name.split("/", 1)[0]
- return full_name, repo_username, repo_name, None
+ organisation = None
+ if full_name.count("/") == 2:
+ organisation = repo_username
+ repo_username = full_name.rsplit("/", 1)[0]
+
+ return full_name, repo_username, repo_name, organisation
def branch(self, data, headers):
if "ref" in data: