Skip to content

Commit

Permalink
Fix usage of github rest APÏ
Browse files Browse the repository at this point in the history
  • Loading branch information
dontcallmedom committed Jun 20, 2024
1 parent abdd8ff commit 4a7d9b2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/reporting/clean-pending-regeneration.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 4a7d9b2

Please sign in to comment.