Skip to content

Commit

Permalink
[actions] fix publish script
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Nov 10, 2022
1 parent 35f6403 commit 58a3c8b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/npm-publish.yml
Expand Up @@ -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') {
Expand Down

0 comments on commit 58a3c8b

Please sign in to comment.