From 4a7d9b22b17503ef216fb651ea14edbc59a55609 Mon Sep 17 00:00:00 2001 From: Dominique Hazael-Massieux Date: Thu, 20 Jun 2024 14:27:32 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20usage=20of=20github=20rest=20AP=C3=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/reporting/clean-pending-regeneration.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/reporting/clean-pending-regeneration.js b/src/reporting/clean-pending-regeneration.js index 0f01c253..d5a1b875 100644 --- a/src/reporting/clean-pending-regeneration.js +++ b/src/reporting/clean-pending-regeneration.js @@ -59,15 +59,15 @@ async function dropPendingReportsWhenPossible (edCrawlResultsPath) { if (lastModified.toJSON() > pr.created_at) { console.log(`PR ${pr.number} may no longer be relevant, closing it`); // if it is, delete the branch, and close the PR - const prData = await octokit.rest.pulls.get({ + const {data: prData} = await octokit.rest.pulls.get({ owner, repo, pull_number: pr.number }); - await octokit.rest.git.deleteRef({ + await octokit.request('DELETE /repos/{owner}/{repo}/git/refs/heads/{ref}', { owner, repo, - ref: prData.head.ref + ref: `${prData.head.ref}` }); await octokit.rest.issues.update({ owner,