From be17f71b27d35722c43f324eb1244791f6f8ee0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20K=C3=B6plinger?= Date: Tue, 18 May 2021 23:24:24 +0200 Subject: [PATCH] Fix backport GitHub Action (#52938) The octokit client we get from @actions/github recently changed their API. --- eng/actions/backport/index.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/eng/actions/backport/index.js b/eng/actions/backport/index.js index a1201acb0bd..775c910784b 100644 --- a/eng/actions/backport/index.js +++ b/eng/actions/backport/index.js @@ -31,13 +31,14 @@ async function run() { try { // verify the comment user is a repo collaborator try { - await octokit.repos.checkCollaborator({ + await octokit.rest.repos.checkCollaborator({ owner: repo_owner, repo: repo_name, username: comment_user }); console.log(`Verified ${comment_user} is a repo collaborator.`); - } catch { + } catch (error) { + console.log(error); throw new BackportException(`Error: @${comment_user} is not a repo collaborator, backporting is not allowed.`); } @@ -125,7 +126,7 @@ async function run() { .replace(/%cc_users%/g, cc_users); // open the GitHub PR - await octokit.pulls.create({ + await octokit.rest.pulls.create({ owner: repo_owner, repo: repo_name, title: backport_pr_title, @@ -142,7 +143,7 @@ async function run() { if (error.postToGitHub === undefined || error.postToGitHub == true) { // post failure to GitHub comment const unknown_error_body = `@${comment_user} an error occurred while backporting to ${target_branch}, please check the run log for details!\n\n${error.message}`; - await octokit.issues.createComment({ + await octokit.rest.issues.createComment({ owner: repo_owner, repo: repo_name, issue_number: pr_number, -- GitLab