From bdd66ee0fd77a21f56ee6e780c321fb09d0ec189 Mon Sep 17 00:00:00 2001 From: lm Date: Mon, 10 Mar 2014 16:35:55 +0800 Subject: [PATCH] [Jenkins] fix the crash in comment trigger --- tools/jenkins-scripts/job-comment-trigger.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/jenkins-scripts/job-comment-trigger.py b/tools/jenkins-scripts/job-comment-trigger.py index bd478d4386..5d1bfd1493 100644 --- a/tools/jenkins-scripts/job-comment-trigger.py +++ b/tools/jenkins-scripts/job-comment-trigger.py @@ -14,6 +14,12 @@ def main(): #parse to json obj payload = json.loads(payload_str) + issue = payload['issue'] + #get pull number + pr_num = issue['number'] + print 'pr_num:' + str(pr_num) + payload_forword = {"number":pr_num} + comment = payload['comment'] #get comment body comment_body = comment['body'] @@ -23,12 +29,6 @@ def main(): if result is None: print 'skip build for pull request #' + str(pr_num) return(0) - - issue = payload['issue'] - #get pull number - pr_num = issue['number'] - print 'pr_num:' + str(pr_num) - payload_forword = {"number":pr_num} #build for pull request action 'open' and 'synchronize', skip 'close' action = issue['state']