Refactored push and tag webhooks for Github (Fixes +++).

This commit is contained in:
Dmitry Khomutov 2017-04-20 21:14:48 +07:00
commit f26f000bb4
No known key found for this signature in database
GPG key ID: 7EB36C9576F9ECB9
2 changed files with 4 additions and 6 deletions

View file

@ -246,7 +246,7 @@ class WebhookController extends Controller
} else {
try {
if ($isTag) {
$branch = str_replace('refs/tags/', 'Tag: ', $payload['ref']);
$branch = str_replace('refs/heads/', '', $payload['base_ref']);
$committer = $payload['pusher']['email'];
} else {
$branch = str_replace('refs/heads/', '', $payload['ref']);
@ -513,7 +513,7 @@ class WebhookController extends Controller
}
// Check if a build already exists for this commit ID:
$builds = $this->buildStore->getByProjectAndCommit($project->getId(), $commitId, $branch);
$builds = $this->buildStore->getByProjectAndCommit($project->getId(), $commitId);
$ignore_environments = [];
if ($builds['count']) {