Skip to content

Commit

Permalink
Better message when CI for base commit is pending
Browse files Browse the repository at this point in the history
  • Loading branch information
acdlite committed Apr 12, 2019
1 parent 9055e31 commit ed67984
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions dangerfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,22 @@ function git(args) {
const statuses = await statusesResponse.json();
for (let i = 0; i < statuses.length; i++) {
const status = statuses[i];
if (status.context === 'ci/circleci' && status.state === 'success') {
baseCIBuildId = /\/facebook\/react\/([0-9]+)/.exec(
status.target_url
)[1];
if (status.context === 'ci/circleci') {
if (status.state === 'success') {
baseCIBuildId = /\/facebook\/react\/([0-9]+)/.exec(
status.target_url
)[1];
break;
}
if (status.state === 'failure') {
warn(`Base commit is broken: ${baseCommit}`);
return;
}
}
}

if (baseCIBuildId === null) {
warn(`Base commit is broken: ${baseCommit}`);
warn(`Could not find build artifacts for base commit: ${baseCommit}`);
return;
}

Expand Down

0 comments on commit ed67984

Please sign in to comment.