diff --git a/script/release/ci-release-build.js b/script/release/ci-release-build.js index 063f09594baf..86189ba6a292 100644 --- a/script/release/ci-release-build.js +++ b/script/release/ci-release-build.js @@ -110,8 +110,9 @@ async function getCircleCIWorkflowId (pipelineId) { switch (pipelineInfo.state) { case 'created': { const workflows = await circleCIRequest(`${pipelineInfoUrl}/workflow`, 'GET'); - if (workflows.items.length === 1) { - workflowId = workflows.items[0].id; + // The logic below expects two workflow.items: publish [0] & setup [1] + if (workflows.items.length === 2) { + workflowId = workflows.items.find(item => item.name.includes('publish')).id; break; } console.log('Unxpected number of workflows, response was:', pipelineInfo);