Skip to content

Commit 321b79d

Browse files
committed
[REF] Use of ssh_url and clone_url instead of repo/owner
1 parent 8afa638 commit 321b79d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

runbot/runbot.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,15 +1308,13 @@ def hook(self, repo_id=None, **post):
13081308
repo_data = request.jsonrequest.get('repository')
13091309
event = request.httprequest.headers.get("X-Github-Event")
13101310
if repo_data and event in ['push', 'pull_request']:
1311-
repo_owner = repo_data['owner'].get('name') or repo_data['owner'].get('login')
1312-
repo_name = repo_data['name']
13131311
repo_domain = [
1314-
'|', ('name', '=', '[email protected]:%s/%s.git' % (repo_owner, repo_name)),
1315-
('name', '=', 'https://github.com/%s/%s.git' % (repo_owner, repo_name)),
1312+
'|', ('name', '=', repo_data['ssh_url']),
1313+
('name', '=', repo_data['clone_url']),
13161314
]
13171315
repo = request.registry['runbot.repo'].search(
13181316
request.cr, SUPERUSER_ID, repo_domain, limit=1)
1319-
repo_id = repo[0] if len(repo) else None
1317+
repo_id = repo[0] if repo else None
13201318

13211319
if repo_id:
13221320
repo = request.registry['runbot.repo'].browse(request.cr, SUPERUSER_ID, [repo_id])

0 commit comments

Comments
 (0)