'forced' pushes do not exist in gitea webhooks

This commit is contained in:
jesopo 2019-06-24 17:37:00 +01:00
parent f10989e8bf
commit cbd35914db

View file

@ -43,7 +43,6 @@ COMMENT_ACTIONS = {
"deleted": "deleted a comment" "deleted": "deleted a comment"
} }
class Gitea(object): class Gitea(object):
def names(self, data, headers): def names(self, data, headers):
full_name = None full_name = None
@ -141,15 +140,15 @@ class Gitea(object):
url = commit["url"] url = commit["url"]
outputs.append( outputs.append(
"%s %spushed %s to %s: %s - %s" "%s pushed %s to %s: %s - %s"
% (author, forced, hash_colored, branch, message, url)) % (author, hash_colored, branch, message, url))
else: else:
first_id = data["before"] first_id = data["before"]
last_id = data["commits"][-1]["id"] last_id = data["commits"][-1]["id"]
url = data["compare_url"] url = data["compare_url"]
outputs.append("%s %spushed %d commits to %s - %s" outputs.append("%s pushed %d commits to %s - %s"
% (author, forced, len(data["commits"]), branch, url)) % (author, len(data["commits"]), branch, url))
return outputs return outputs