aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar jesopo2019-06-28 15:29:59 +0100
committerGravatar jesopo2019-06-28 15:29:59 +0100
commite6d8e75086096f753d9e6b3d3cbe3e537aaaf13f (patch)
tree382c6ee7834aaca263c886993c6061550967addd
parentremove dangling "," left over from moving code (diff)
signature
DEBUG log when trying to git.io-shorten a github url
-rw-r--r--modules/git_webhooks/__init__.py2
-rw-r--r--modules/git_webhooks/github.py5
2 files changed, 6 insertions, 1 deletions
diff --git a/modules/git_webhooks/__init__.py b/modules/git_webhooks/__init__.py
index 83e27d68..b76ec4a3 100644
--- a/modules/git_webhooks/__init__.py
+++ b/modules/git_webhooks/__init__.py
@@ -26,7 +26,7 @@ class Module(ModuleManager.BaseModule):
_name = "Webhooks"
def on_load(self):
- self._github = github.GitHub()
+ self._github = github.GitHub(self.log)
self._gitea = gitea.Gitea()
@utils.hook("api.post.github")
diff --git a/modules/git_webhooks/github.py b/modules/git_webhooks/github.py
index 2b9c66f7..5d1420b3 100644
--- a/modules/git_webhooks/github.py
+++ b/modules/git_webhooks/github.py
@@ -83,6 +83,9 @@ CHECK_RUN_CONCLUSION = {
CHECK_RUN_FAILURES = ["failure", "cancelled", "timed_out", "action_required"]
class GitHub(object):
+ def __init__(self, log):
+ self.log = log
+
def is_private(self, data, headers):
if "repository" in data:
return data["repository"]["private"]
@@ -147,7 +150,9 @@ class GitHub(object):
return self.membership(organisation, data)
elif event == "watch":
return self.watch(data)
+
def _short_url(self, url):
+ self.log.debug("git.io shortening: %s" % url)
try:
page = utils.http.request("https://git.io", method="POST",
post_data={"url": url})