From d0b18060fc52ab8023e5df09703e8d4b2577a5cb Mon Sep 17 00:00:00 2001 From: benStre Date: Wed, 17 Jan 2024 19:59:57 +0100 Subject: [PATCH] update github-script --- .github/workflows/update-prs.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-prs.yml b/.github/workflows/update-prs.yml index 94ec6e3d..52fad32b 100644 --- a/.github/workflows/update-prs.yml +++ b/.github/workflows/update-prs.yml @@ -23,8 +23,9 @@ jobs: } }) - console.log(prs); for (const pr of prs.data) { + if (pr.state !== 'open') continue; + console.log("Refreshing PR diff for #" + pr.number + " (" + pr.title + ")"); await github.request('PATCH /repos/{owner}/{repo}/pulls/{pull_number}', { owner: context.repo.owner, repo: context.repo.repo, @@ -34,5 +35,13 @@ jobs: 'X-GitHub-Api-Version': '2022-11-28' } }) - break; + await github.request('PATCH /repos/{owner}/{repo}/pulls/{pull_number}', { + owner: context.repo.owner, + repo: context.repo.repo, + pull_number: pr.number, + base: 'main', + headers: { + 'X-GitHub-Api-Version': '2022-11-28' + } + }) }