workflow: improve release script ci status check

This commit is contained in:
Evan You 2024-06-14 17:59:12 +02:00
parent 8296e19855
commit 1e42f24d8f
No known key found for this signature in database
GPG Key ID: B9D421896CA450FB
1 changed files with 4 additions and 1 deletions

View File

@ -352,8 +352,11 @@ async function getCIResult() {
`https://api.github.com/repos/vuejs/core/actions/runs?head_sha=${sha}` +
`&status=success&exclude_pull_requests=true`,
)
/** @type {{ workflow_runs: ({ name: string, conclusion: string })[] }} */
const data = await res.json()
return data.workflow_runs.length > 0
return data.workflow_runs.some(({ name, conclusion }) => {
return name === 'ci' && conclusion === 'success'
})
} catch {
console.error('Failed to get CI status for current commit.')
return false