From 1e42f24d8f212efdcc9dbdbe5b66b899f690c255 Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 14 Jun 2024 17:59:12 +0200 Subject: [PATCH] workflow: improve release script ci status check --- scripts/release.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/release.js b/scripts/release.js index d34f26d4b..4a0c968e2 100644 --- a/scripts/release.js +++ b/scripts/release.js @@ -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