diff --git a/scripts/release/prepare-canary-commands/download-build-artifacts.js b/scripts/release/prepare-canary-commands/download-build-artifacts.js index 2996796023..06c963242f 100644 --- a/scripts/release/prepare-canary-commands/download-build-artifacts.js +++ b/scripts/release/prepare-canary-commands/download-build-artifacts.js @@ -16,9 +16,22 @@ const run = async ({build, cwd}) => { process.env.CIRCLE_CI_API_TOKEN }`; const metadata = await http.get(metadataURL, true); - const nodeModulesURL = metadata.find( + const nodeModulesArtifact = metadata.find( entry => entry.path === 'home/circleci/project/node_modules.tgz' - ).url; + ); + + if (!nodeModulesArtifact) { + console.log( + theme`{error The specified build number does not contain any build artifacts}\n\n` + + 'To get the correct build number from Circle CI, open the following URL:\n' + + theme`{link https://circleci.com/gh/facebook/react/${build}}\n\n` + + 'Select the "commit" Workflow at the top of the page, then select the "process_artifacts" job.' + ); + + process.exit(1); + } + + const nodeModulesURL = nodeModulesArtifact.url; if (!existsSync(join(cwd, 'build'))) { await exec(`mkdir ./build`, {cwd}); diff --git a/scripts/release/prepare-canary-commands/get-latest-master-build-number.js b/scripts/release/prepare-canary-commands/get-latest-master-build-number.js index c4c6f36842..a87361ecbc 100644 --- a/scripts/release/prepare-canary-commands/get-latest-master-build-number.js +++ b/scripts/release/prepare-canary-commands/get-latest-master-build-number.js @@ -10,7 +10,10 @@ const run = async () => { const metadataURL = `https://circleci.com/api/v1.1/project/github/facebook/react/tree/master`; const metadata = await http.get(metadataURL, true); const build = metadata.find( - entry => entry.branch === 'master' && entry.status === 'success' + entry => + entry.branch === 'master' && + entry.status === 'success' && + entry.workflows.job_name === 'process_artifacts' ).build_num; return build;