Skip to content

Commit

Permalink
travis: modify parameter from 'false' to False (#62)
Browse files Browse the repository at this point in the history
* travis: when TRAVIS_REPO_SLUG is false , not send comment“

Signed-off-by: Jingru <[email protected]>

* travis: modify parameter from 'false' to False

Signed-off-by: Jingru <[email protected]>
  • Loading branch information
wangnuannuan authored and fanghuaqi committed Oct 8, 2018
1 parent 44a3be4 commit 2976404
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .ci/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,11 @@ def comment_on_pull_request(comment):
pr_number = os.environ.get("TRAVIS_PULL_REQUEST")
slug = os.environ.get("TRAVIS_REPO_SLUG")
token = os.environ.get("GH_TOKEN")
if all([pr_number, slug, token, comment]):
request_config = [pr_number, slug, token, comment]
for i in range(len(request_config)):
if request_config[i] == "false":
request_config[i] = False
if all(request_config):
url = 'https://api.github.com/repos/{slug}/issues/{number}/comments'.format(
slug=slug, number=pr_number)
response = requests.post(url, data=json.dumps({'body': comment}),
Expand Down

0 comments on commit 2976404

Please sign in to comment.