diff --git a/phab-comment.php b/phab-comment.php index 02f55cc..ae75e1b 100755 --- a/phab-comment.php +++ b/phab-comment.php @@ -1,57 +1,52 @@ #!/usr/bin/php <?php /** * Script that publish a comment with a builded resource. */ require 'config.php'; // document ID provided as first argument $phid = $argv[1]; // URL provided as second argument $url = $argv[2]; // sha256 provided $sha256 = $argv[3]; // filename extracted from URL $filename = basename( $url ); // load Phabricator's framework //require_once '/home/www-data/gitpull.it/libphutil/src/__phutil_library_init__.php'; require_once '/home/www-data/gitpull.it/arcanist/src/__phutil_library_init__.php'; $message = sprintf( - "{icon cog spin} Be bop be bop. I'm a bot. Builded:". + "{icon cog spin} Be bop be bop. I'm a bot. Builded successfully ✨". "\n\n". - "→ [[%1\$s|%2\$s]]". + "{icon download} **[[%1\$s|%2\$s]]**". "\n\n". " sha256 %3\$s\n", $argv[2], $filename, $sha256 ); // create API request $api_parameters = [ 'objectIdentifier' => $argv[1], 'transactions' => [ [ 'type' => 'comment', 'value' => $message, - ] + ], ], ]; $client = new ConduitClient('https://gitpull.it/'); $client->setConduitToken(PHABRICATOR_API_TOKEN); -try { - $result = $client->callMethodSynchronous('differential.revision.edit', $api_parameters); - //print_r($result); -} catch( Exception $e ) { - print_r( $api_parameters ); - echo "ERROR COMMENTING: " . $e->getMessage() . "\n"; -} +$result = $client->callMethodSynchronous('differential.revision.edit', $api_parameters); +//print_r($result);