Skip to content

Commit ed67984

Browse files
committed
Better message when CI for base commit is pending
1 parent 9055e31 commit ed67984

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

dangerfile.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,15 +127,22 @@ function git(args) {
127127
const statuses = await statusesResponse.json();
128128
for (let i = 0; i < statuses.length; i++) {
129129
const status = statuses[i];
130-
if (status.context === 'ci/circleci' && status.state === 'success') {
131-
baseCIBuildId = /\/facebook\/react\/([0-9]+)/.exec(
132-
status.target_url
133-
)[1];
130+
if (status.context === 'ci/circleci') {
131+
if (status.state === 'success') {
132+
baseCIBuildId = /\/facebook\/react\/([0-9]+)/.exec(
133+
status.target_url
134+
)[1];
135+
break;
136+
}
137+
if (status.state === 'failure') {
138+
warn(`Base commit is broken: ${baseCommit}`);
139+
return;
140+
}
134141
}
135142
}
136143

137144
if (baseCIBuildId === null) {
138-
warn(`Base commit is broken: ${baseCommit}`);
145+
warn(`Could not find build artifacts for base commit: ${baseCommit}`);
139146
return;
140147
}
141148

0 commit comments

Comments
 (0)