mirror of https://github.com/axmolengine/axmol.git
Merge pull request #5002 from heliclei/develop
support [ci skip] in commit message
This commit is contained in:
commit
b454bf01e3
|
@ -19,7 +19,7 @@ r = requests.get(api_get_pr)
|
|||
pr = r.json()
|
||||
|
||||
#forge a payload
|
||||
payload = {"action":"open","number":"","pull_request":""}
|
||||
payload = {"action":"opened","number":"","pull_request":""}
|
||||
payload['number']=pr_num
|
||||
payload['pull_request']=pr
|
||||
|
||||
|
|
|
@ -38,9 +38,8 @@ def main():
|
|||
action = payload['action']
|
||||
print 'action: ' + action
|
||||
|
||||
|
||||
|
||||
pr = payload['pull_request']
|
||||
|
||||
url = pr['html_url']
|
||||
print "url:" + url
|
||||
pr_desc = '<h3><a href='+ url + '> pr#' + str(pr_num) + ' is '+ action +'</a></h3>'
|
||||
|
@ -61,7 +60,18 @@ def main():
|
|||
if((action != 'opened') and (action != 'synchronize')):
|
||||
print 'pull request #' + str(pr_num) + ' is '+action+', no build triggered'
|
||||
return(0)
|
||||
|
||||
r = requests.get(pr['url']+"/commits")
|
||||
commits = r.json()
|
||||
last_commit = commits[len(commits)-1]
|
||||
message = last_commit['commit']['message']
|
||||
|
||||
pattern = re.compile("\[ci(\s+)skip\]", re.I)
|
||||
result = pattern.search(message)
|
||||
if result is not None:
|
||||
print 'skip build for pull request #' + str(pr_num)
|
||||
return(0)
|
||||
|
||||
data = {"state":"pending", "target_url":target_url}
|
||||
access_token = os.environ['GITHUB_ACCESS_TOKEN']
|
||||
Headers = {"Authorization":"token " + access_token}
|
||||
|
|
Loading…
Reference in New Issue