From 4efb436e2b31e958635d496aa114cd3c005d940c Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sat, 17 Oct 2020 11:09:49 +0800 Subject: [PATCH] build-integration-branch: send token in the header see https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/ Signed-off-by: Kefu Chai --- src/script/build-integration-branch | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/script/build-integration-branch b/src/script/build-integration-branch index f5cc4c10644..511a950d44b 100755 --- a/src/script/build-integration-branch +++ b/src/script/build-integration-branch @@ -62,16 +62,15 @@ with open(os.environ['HOME'] + '/.github_token', 'r') as myfile: # get prs baseurl = urljoin('https://api.github.com', ( 'repos/{repo}/issues?labels={label}' - '&access_token={token}' '&sort=created' '&direction=asc' ) ) url = baseurl.format( label=label, - repo=repo, - token=token) -r = requests.get(url) + repo=repo) +r = requests.get(url, + headers={'Authorization': 'token %s' % token}) assert(r.ok) j = json.loads(r.text or r.content) print("--- found %d issues tagged with %s" % (len(j), label)) @@ -81,7 +80,8 @@ prtext = [] for issue in j: if 'pull_request' not in issue: continue - r = requests.get(issue['pull_request']['url'] + '?access_token=' + token) + r = requests.get(issue['pull_request']['url'], + headers={'Authorization': 'token %s' % token}) pr = json.loads(r.text or r.content) prs.append(pr) prtext.append(pr['html_url'] + ' - ' + pr['title']) -- 2.39.5