This commit is contained in:
Pererinha 2015-02-06 15:52:07 -02:00
commit 5a07f4df10
2 changed files with 3 additions and 3 deletions

View File

@ -1,8 +1,8 @@
<?php <?php
class Cockpit_Github extends Cana_Model { class Cockpit_Github extends Cana_Model {
public static function commits($user, $repo) { public static function commits($user, $repo, $branch = 'master') {
return c::github()->api('repo')->commits()->all($user, $repo, ['sha' => 'master']); return c::github()->api('repo')->commits()->all($user, $repo, ['sha' => $branch]);
} }
public static function createTag($user, $repo, $tag, $sha = '', $body = '') { public static function createTag($user, $repo, $tag, $sha = '', $body = '') {

View File

@ -53,7 +53,7 @@ class Crunchbutton_Deploy_Server extends Cana_Table {
if (!isset($this->_commits)) { if (!isset($this->_commits)) {
$this->_commits = []; $this->_commits = [];
$repo = explode('/', $this->repo); $repo = explode('/', $this->repo);
$logs = Github::commits($repo[0], $repo[1]); $logs = Github::commits($repo[0], $repo[1], $repo[2]);
if ($logs) { if ($logs) {
$travis = new Travis; $travis = new Travis;
$status = $travis->status($repo[0],$repo[1]); $status = $travis->status($repo[0],$repo[1]);