diff --git a/lib/Github/Api/Repository/Checks/CheckRuns.php b/lib/Github/Api/Repository/Checks/CheckRuns.php index 6f91997e8b4..d1e456212ce 100644 --- a/lib/Github/Api/Repository/Checks/CheckRuns.php +++ b/lib/Github/Api/Repository/Checks/CheckRuns.php @@ -3,12 +3,15 @@ namespace Github\Api\Repository\Checks; use Github\Api\AbstractApi; +use Github\Api\AcceptHeaderTrait; /** * @link https://docs.github.com/en/free-pro-team@latest/rest/reference/checks */ class CheckRuns extends AbstractApi { + use AcceptHeaderTrait; + /** * @link https://docs.github.com/en/free-pro-team@latest/rest/reference/checks#create-a-check-run * @@ -16,6 +19,8 @@ class CheckRuns extends AbstractApi */ public function create(string $username, string $repository, array $params = []) { + $this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json'; + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/check-runs', $params); } @@ -26,6 +31,8 @@ public function create(string $username, string $repository, array $params = []) */ public function show(string $username, string $repository, int $checkRunId) { + $this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json'; + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/check-runs/'.$checkRunId); } @@ -36,6 +43,8 @@ public function show(string $username, string $repository, int $checkRunId) */ public function update(string $username, string $repository, int $checkRunId, array $params = []) { + $this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json'; + return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/check-runs/'.$checkRunId, $params); } @@ -46,6 +55,8 @@ public function update(string $username, string $repository, int $checkRunId, ar */ public function annotations(string $username, string $repository, int $checkRunId) { + $this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json'; + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/check-runs/'.$checkRunId.'/annotations'); } @@ -56,6 +67,8 @@ public function annotations(string $username, string $repository, int $checkRunI */ public function allForCheckSuite(string $username, string $repository, int $checkSuiteId, array $params = []) { + $this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json'; + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/check-suites/'.$checkSuiteId.'/check-runs', $params); } @@ -66,6 +79,8 @@ public function allForCheckSuite(string $username, string $repository, int $chec */ public function allForReference(string $username, string $repository, string $ref, array $params = []) { + $this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json'; + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/commits/'.rawurlencode($ref).'/check-runs', $params); } } diff --git a/lib/Github/Api/Repository/Checks/CheckSuites.php b/lib/Github/Api/Repository/Checks/CheckSuites.php index d597fed54e7..ca6b432eb83 100644 --- a/lib/Github/Api/Repository/Checks/CheckSuites.php +++ b/lib/Github/Api/Repository/Checks/CheckSuites.php @@ -3,12 +3,15 @@ namespace Github\Api\Repository\Checks; use Github\Api\AbstractApi; +use Github\Api\AcceptHeaderTrait; /** * @link https://docs.github.com/en/free-pro-team@latest/rest/reference/checks */ class CheckSuites extends AbstractApi { + use AcceptHeaderTrait; + /** * @link https://docs.github.com/en/free-pro-team@latest/rest/reference/checks#create-a-check-suite * @@ -16,6 +19,8 @@ class CheckSuites extends AbstractApi */ public function create(string $username, string $repository, array $params = []) { + $this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json'; + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/check-suites', $params); } @@ -26,6 +31,8 @@ public function create(string $username, string $repository, array $params = []) */ public function updatePreferences(string $username, string $repository, array $params = []) { + $this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json'; + return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/check-suites/preferences', $params); } @@ -36,6 +43,8 @@ public function updatePreferences(string $username, string $repository, array $p */ public function getCheckSuite(string $username, string $repository, int $checkSuiteId) { + $this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json'; + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/check-suites/'.$checkSuiteId); } @@ -46,6 +55,8 @@ public function getCheckSuite(string $username, string $repository, int $checkSu */ public function rerequest(string $username, string $repository, int $checkSuiteId) { + $this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json'; + return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/check-suites/'.$checkSuiteId.'/rerequest'); } @@ -56,6 +67,8 @@ public function rerequest(string $username, string $repository, int $checkSuiteI */ public function allForReference(string $username, string $repository, string $ref, array $params = []) { + $this->acceptHeaderValue = 'application/vnd.github.antiope-preview+json'; + return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/commits/'.rawurlencode($ref).'/check-suites', $params); } }