Skip to content

Commit 2976404

Browse files
wangnuannuanfanghuaqi
authored andcommitted
travis: modify parameter from 'false' to False (#62)
* 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]>
1 parent 44a3be4 commit 2976404

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

.ci/build.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,11 @@ def comment_on_pull_request(comment):
570570
pr_number = os.environ.get("TRAVIS_PULL_REQUEST")
571571
slug = os.environ.get("TRAVIS_REPO_SLUG")
572572
token = os.environ.get("GH_TOKEN")
573-
if all([pr_number, slug, token, comment]):
573+
request_config = [pr_number, slug, token, comment]
574+
for i in range(len(request_config)):
575+
if request_config[i] == "false":
576+
request_config[i] = False
577+
if all(request_config):
574578
url = 'https://api.github.com/repos/{slug}/issues/{number}/comments'.format(
575579
slug=slug, number=pr_number)
576580
response = requests.post(url, data=json.dumps({'body': comment}),

0 commit comments

Comments
 (0)