quicksilver-examples
quicksilver-examples copied to clipboard
Slack notifications not passing on commit details
Using the example slack_notifications.php, the commit ID and message weren't being passed on to Slack. It looks like $fields array wasn't merged properly. To resolve, I changed the following from line 78:
$fields += array(
array(
'title' => 'Commit',
'value' => rtrim($hash),
'short' => 'true'
),
array(
'title' => 'Commit Message',
'value' => $message,
'short' => 'false'
)
);
To this:
$fields[] = array(
'title' => 'Commit',
'value' => rtrim($hash),
'short' => 'true'
);
$fields[] = array(
'title' => 'Commit Message',
'value' => $message,
'short' => 'false'
);
Possibly the numeric keys generated by PHP for the second array start at 0 so are ignored when using +=.