mirror of https://github.com/docker/docs.git
Prevent docker-ci to test closing PRs
This commit is contained in:
parent
93b258413f
commit
53a07d5475
|
@ -90,12 +90,12 @@ def getChanges(request, options = None):
|
||||||
fname = str(datetime.datetime.now()).replace(' ','_').replace(':','-')[:19]
|
fname = str(datetime.datetime.now()).replace(' ','_').replace(':','-')[:19]
|
||||||
open('github_{0}.json'.format(fname),'w').write(json.dumps(json.loads(urllib.unquote(request.args['payload'][0])), sort_keys = True, indent = 2))
|
open('github_{0}.json'.format(fname),'w').write(json.dumps(json.loads(urllib.unquote(request.args['payload'][0])), sort_keys = True, indent = 2))
|
||||||
|
|
||||||
if 'pull_request' in payload:
|
if 'pull_request' in payload:
|
||||||
user = payload['pull_request']['user']['login']
|
user = payload['pull_request']['user']['login']
|
||||||
repo = payload['pull_request']['head']['repo']['name']
|
repo = payload['pull_request']['head']['repo']['name']
|
||||||
repo_url = payload['pull_request']['head']['repo']['html_url']
|
repo_url = payload['pull_request']['head']['repo']['html_url']
|
||||||
else:
|
else:
|
||||||
user = payload['repository']['owner']['name']
|
user = payload['repository']['owner']['name']
|
||||||
repo = payload['repository']['name']
|
repo = payload['repository']['name']
|
||||||
repo_url = payload['repository']['url']
|
repo_url = payload['repository']['url']
|
||||||
project = request.args.get('project', None)
|
project = request.args.get('project', None)
|
||||||
|
@ -119,7 +119,7 @@ def process_change(payload, user, repo, repo_url, project):
|
||||||
Hook.
|
Hook.
|
||||||
"""
|
"""
|
||||||
changes = []
|
changes = []
|
||||||
|
|
||||||
newrev = payload['after'] if 'after' in payload else payload['pull_request']['head']['sha']
|
newrev = payload['after'] if 'after' in payload else payload['pull_request']['head']['sha']
|
||||||
refname = payload['ref'] if 'ref' in payload else payload['pull_request']['head']['ref']
|
refname = payload['ref'] if 'ref' in payload else payload['pull_request']['head']['ref']
|
||||||
|
|
||||||
|
@ -134,9 +134,12 @@ def process_change(payload, user, repo, repo_url, project):
|
||||||
log.msg("Branch `%s' deleted, ignoring" % branch)
|
log.msg("Branch `%s' deleted, ignoring" % branch)
|
||||||
return []
|
return []
|
||||||
else:
|
else:
|
||||||
if 'pull_request' in payload:
|
if 'pull_request' in payload:
|
||||||
changes = [{
|
if payload['action'] == 'closed':
|
||||||
'category' : 'github_pullrequest',
|
log.msg("PR#{} closed, ignoring".format(payload['number']))
|
||||||
|
return []
|
||||||
|
changes = [{
|
||||||
|
'category' : 'github_pullrequest',
|
||||||
'who' : '{0} - PR#{1}'.format(user,payload['number']),
|
'who' : '{0} - PR#{1}'.format(user,payload['number']),
|
||||||
'files' : [],
|
'files' : [],
|
||||||
'comments' : payload['pull_request']['title'],
|
'comments' : payload['pull_request']['title'],
|
||||||
|
@ -146,7 +149,7 @@ def process_change(payload, user, repo, repo_url, project):
|
||||||
'revlink' : '{0}/commit/{1}'.format(repo_url,newrev),
|
'revlink' : '{0}/commit/{1}'.format(repo_url,newrev),
|
||||||
'repository' : repo_url,
|
'repository' : repo_url,
|
||||||
'project' : project }]
|
'project' : project }]
|
||||||
return changes
|
return changes
|
||||||
for commit in payload['commits']:
|
for commit in payload['commits']:
|
||||||
files = []
|
files = []
|
||||||
if 'added' in commit:
|
if 'added' in commit:
|
||||||
|
@ -170,4 +173,3 @@ def process_change(payload, user, repo, repo_url, project):
|
||||||
project = project)
|
project = project)
|
||||||
changes.append(chdict)
|
changes.append(chdict)
|
||||||
return changes
|
return changes
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue