git: Refactor to a lookup table
This commit is contained in:
parent
89ef98a15b
commit
87d5b689b2
|
@ -36,9 +36,12 @@ class ClosesPullRequests
|
||||||
echo 'Confirming ci-status on PR is green...' . PHP_EOL;
|
echo 'Confirming ci-status on PR is green...' . PHP_EOL;
|
||||||
|
|
||||||
// TODO: Check for failures, or skip if there is no CI.
|
// TODO: Check for failures, or skip if there is no CI.
|
||||||
switch (exec('hub ci-status')) {
|
$errors = [
|
||||||
case self::CI_PENDING:
|
self::CI_PENDING => 'Aborting: CI pending',
|
||||||
die('Aborting: CI pending');
|
];
|
||||||
|
|
||||||
|
if (array_key_exists($status = exec('hub ci-status'), $errors)) {
|
||||||
|
die($errors[$status]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue