From 886a932a1a09a567bd790ea949d9ccc9df86cdba Mon Sep 17 00:00:00 2001 From: Lidi Zheng Date: Tue, 18 Dec 2018 14:24:58 -0800 Subject: Use KOKORO_GITHUB_PULL_REQUEST_NUMBER instead of ghprbPullId --- tools/run_tests/python_utils/check_on_pr.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'tools') diff --git a/tools/run_tests/python_utils/check_on_pr.py b/tools/run_tests/python_utils/check_on_pr.py index d59f99b252..3f335c8ea9 100644 --- a/tools/run_tests/python_utils/check_on_pr.py +++ b/tools/run_tests/python_utils/check_on_pr.py @@ -71,8 +71,9 @@ def _call(url, method='GET', json=None): def _latest_commit(): - resp = _call('/repos/%s/pulls/%s/commits' % (_GITHUB_REPO, - os.environ['ghprbPullId'])) + resp = _call('/repos/%s/pulls/%s/commits' % + (_GITHUB_REPO, + os.environ['KOKORO_GITHUB_PULL_REQUEST_NUMBER'])) return resp.json()[-1] @@ -82,7 +83,7 @@ def check_on_pr(name, summary, success=True): The check runs are aggregated by their name, so newer check will update the older check with the same name. - Requires environment variable 'ghprbPullId' to indicate which pull request + Requires environment variable 'KOKORO_GITHUB_PULL_REQUEST_NUMBER' to indicate which pull request should be updated. Args: @@ -96,8 +97,8 @@ def check_on_pr(name, summary, success=True): if 'KOKORO_KEYSTORE_DIR' not in os.environ: print('Missing KOKORO_KEYSTORE_DIR env var: not checking') return - if 'ghprbPullId' not in os.environ: - print('Missing ghprbPullId env var: not checking') + if 'KOKORO_GITHUB_PULL_REQUEST_NUMBER' not in os.environ: + print('Missing KOKORO_GITHUB_PULL_REQUEST_NUMBER env var: not checking') return completion_time = str( datetime.datetime.utcnow().replace(microsecond=0).isoformat()) + 'Z' -- cgit v1.2.3