From 58a3c8b2b38c9176d6aed32ac026657c9b43e03f Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Thu, 10 Nov 2022 13:01:38 -0500 Subject: [PATCH] [actions] fix publish script --- .github/workflows/npm-publish.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 24055688fd..2b9a799002 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -55,24 +55,26 @@ jobs: const { owner, repo } = context.repo; const { default_branch: branch } = context.payload.repository; - const branch = github.rest.repos.getBranch({ owner, repo, branch }); + const branchData = github.rest.repos.getBranch({ owner, repo, branch }); const checkSuites = await github.rest.checks.listSuitesForRef({ owner, repo, ref }); + console.log(checkSuites); + if (checkSuites.some(({ status }) => 'completed')) { core.setFailed(`Some workflows for ${context.payload.inputs.tag} are still in-progress`); } const { data: { check_runs: checkRuns } } = await Promise.all( - (await branch).data.protection.required_status_checks.checks.map(({ context }) => ( + (await branchData).data.protection.required_status_checks.checks.map(({ context }) => ( github.rest.checks.listForRef({ owner, repo, ref, - check_name: context + check_name: context, }) - ) - ) + )) + ); checkRuns.forEach(({ name, status, conclusion }) => { if (status !== 'completed' || conclusion !== 'success') {