Ensure release ZIP is built from latest commit

[MAILPOET-1883]
This commit is contained in:
Jan Jakeš
2019-04-10 13:03:43 +02:00
committed by wxa
parent b33c149d6f
commit 400fb7f559
2 changed files with 22 additions and 0 deletions

View File

@ -43,6 +43,19 @@ class GitHubController {
$this->publishDraftAsRelease($release_info['id']);
}
public function getLatestCommitRevisionOnBranch($branch) {
try {
$response = $this->http_client->get('commits/' . urlencode($branch));
$data = json_decode($response->getBody()->getContents(), true);
} catch (ClientException $e) {
if ($e->getCode() === 404) {
return null;
}
throw $e;
}
return $data['sha'];
}
private function ensureNoDraftReleaseExists() {
$response = $this->http_client->get('releases');
$data = json_decode($response->getBody()->getContents(), true);