diff --git a/chirp.inc.php b/chirp.inc.php index 77c56b2..dedb8d0 100644 --- a/chirp.inc.php +++ b/chirp.inc.php @@ -221,8 +221,9 @@ function gitea_check_repo( ) { $r = new Reporters(); - $r->add(new SlackReporter()); $r->add(new CliReporter()); + if($opts['log_to_slack']) + $r->add(new SlackReporter()); $r->write("************************* Chirping about repo '$base_repo' *************************\n"); diff --git a/chirp.php b/chirp.php index 0773ae6..f7ecf42 100644 --- a/chirp.php +++ b/chirp.php @@ -5,6 +5,7 @@ $user = getenv('GITEA_USER'); $pass = getenv('GITEA_PASS'); $gitea_url = 'https://git.bit5.ru'; +$log_to_slack = !in_array('--dry-run', $argv); $auth_token = hoopoe\gitea_login($gitea_url, $user, $pass); if(!$auth_token) @@ -14,28 +15,32 @@ hoopoe\gitea_check_repo($auth_token, $gitea_url, 'bit/skeletik', array( 'check_forks' => true, 'check_composer' => true, - 'check_upm' => false + 'check_upm' => false, + 'log_to_slack' => $log_to_slack, ) ); hoopoe\gitea_check_repo($auth_token, $gitea_url, 'bit/skeletor', array( 'check_forks' => true, 'check_composer' => true, - 'check_upm' => true + 'check_upm' => true, + 'log_to_slack' => $log_to_slack, ) ); hoopoe\gitea_check_repo($auth_token, $gitea_url, 'bit/skeletor-rnd', array( 'check_forks' => true, 'check_composer' => true, - 'check_upm' => true + 'check_upm' => true, + 'log_to_slack' => $log_to_slack, ) ); hoopoe\gitea_check_repo($auth_token, $gitea_url, 'game/gymmania', array( 'check_forks' => false, 'check_composer' => true, - 'check_upm' => false + 'check_upm' => false, + 'log_to_slack' => $log_to_slack, ) );