From 1805d50bb88c12d61c7dded19f61762f8f252869 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Mon, 21 Dec 2020 18:09:07 -0500 Subject: [PATCH] fix parser tests updater again (#12538) --- .github/workflows/update-parser-tests.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/update-parser-tests.yml b/.github/workflows/update-parser-tests.yml index c225b4fd93..3a46ad016a 100644 --- a/.github/workflows/update-parser-tests.yml +++ b/.github/workflows/update-parser-tests.yml @@ -57,14 +57,19 @@ jobs: github-token: ${{ secrets.BOT_TOKEN }} script: | const base = process.env.GITHUB_REF.replace("refs/heads/", ""); - const { data: prs } = await github.pulls.list({ + const requestParam = { owner: context.repo.owner, repo: context.repo.repo, - head: "update-test262-parser", - base: base - }); + head: context.repo.owner + ":update-test262-parser", + base: base, + state: "open" + }; + const result = await github.pulls.list(requestParam); + console.log("Open PR request: ", requestParam); + console.log("Open PR response: ", result); + const prs = result.data; if (prs.length === 0) { - const { data: pr } = await github.pulls.create({ + const requestParam = { owner: context.repo.owner, repo: context.repo.repo, head: "update-test262-parser", @@ -72,12 +77,15 @@ jobs: maintainer_can_modify: true, title: "Update test262", body: "Update test262 to [${{ steps.test262.outputs.sha1 }}](https://github.com/tc39/test262/commit/${{ steps.test262.outputs.sha1 }}).", - }); + }; + const result = await github.pulls.create(requestParam); + console.log("Create PR request: ", requestParam) + console.log("Create PR response: ", result); github.issues.addLabels({ owner: context.repo.owner, repo: context.repo.repo, - issue_number: pr.number, + issue_number: result.data.number, labels: ["area: test262", "repo automation 🤖"] }) }