build: account for path-filtering workflow in release-build script (#32063)

* build: account for path-filtering workflow in release-build script

* build: update syntax for workflow id

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>

Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
This commit is contained in:
Keeley Hammond 2021-11-30 09:17:04 -08:00 committed by GitHub
parent 3278ff6a05
commit 83a4b234d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);