diff --git a/mass-rebuild-filter.php b/mass-rebuild-filter.php index 277ba95..2d51533 100644 --- a/mass-rebuild-filter.php +++ b/mass-rebuild-filter.php @@ -33,6 +33,7 @@ function outrunner($msg) { } function runner($msg) { + echo "Msg Sha: " . md5($msg->body) . "\n"; $in = json_decode($msg->body); try { @@ -92,7 +93,7 @@ function runner($msg) { $msg->delivery_info['channel']->basic_ack($msg->delivery_info['delivery_tag']); return true; } else { - echo "so-called interesting event: " . $in->action . "\n"; + echo "so-called interesting event on #" . $in->number . ": " . $in->action . "\n"; } $forward = [ diff --git a/src/EventClassifier.php b/src/EventClassifier.php index 2d34481..85ce1da 100644 --- a/src/EventClassifier.php +++ b/src/EventClassifier.php @@ -64,6 +64,10 @@ class EventClassifier { return "project_column"; } + if (self::isLabelEvent($payload)) { + return "label"; + } + throw new EventClassifierUnknownException(); } @@ -169,6 +173,12 @@ class EventClassifier { return isset($payload->project_column); } + public static function isLabelEvent($payload) { + return isset($payload->label) + && isset($payload->action) + && in_array($payload->action, + ['created', 'edited', 'deleted']); + } }