33namespace Github \Api \Repository \Checks ;
44
55use Github \Api \AbstractApi ;
6+ use Github \Api \AcceptHeaderTrait ;
67
78/**
89 * @link https://docs.github.com/en/free-pro-team@latest/rest/reference/checks
910 */
1011class CheckRuns extends AbstractApi
1112{
13+ use AcceptHeaderTrait;
14+
1215 /**
1316 * @link https://docs.github.com/en/free-pro-team@latest/rest/reference/checks#create-a-check-run
1417 *
1518 * @return array
1619 */
1720 public function create (string $ username , string $ repository , array $ params = [])
1821 {
22+ $ this ->acceptHeaderValue = 'application/vnd.github.antiope-preview+json ' ;
23+
1924 return $ this ->post ('/repos/ ' .rawurlencode ($ username ).'/ ' .rawurlencode ($ repository ).'/check-runs ' , $ params );
2025 }
2126
@@ -26,6 +31,8 @@ public function create(string $username, string $repository, array $params = [])
2631 */
2732 public function show (string $ username , string $ repository , int $ checkRunId )
2833 {
34+ $ this ->acceptHeaderValue = 'application/vnd.github.antiope-preview+json ' ;
35+
2936 return $ this ->get ('/repos/ ' .rawurlencode ($ username ).'/ ' .rawurlencode ($ repository ).'/check-runs/ ' .$ checkRunId );
3037 }
3138
@@ -36,6 +43,8 @@ public function show(string $username, string $repository, int $checkRunId)
3643 */
3744 public function update (string $ username , string $ repository , int $ checkRunId , array $ params = [])
3845 {
46+ $ this ->acceptHeaderValue = 'application/vnd.github.antiope-preview+json ' ;
47+
3948 return $ this ->patch ('/repos/ ' .rawurlencode ($ username ).'/ ' .rawurlencode ($ repository ).'/check-runs/ ' .$ checkRunId , $ params );
4049 }
4150
@@ -46,6 +55,8 @@ public function update(string $username, string $repository, int $checkRunId, ar
4655 */
4756 public function annotations (string $ username , string $ repository , int $ checkRunId )
4857 {
58+ $ this ->acceptHeaderValue = 'application/vnd.github.antiope-preview+json ' ;
59+
4960 return $ this ->get ('/repos/ ' .rawurlencode ($ username ).'/ ' .rawurlencode ($ repository ).'/check-runs/ ' .$ checkRunId .'/annotations ' );
5061 }
5162
@@ -56,6 +67,8 @@ public function annotations(string $username, string $repository, int $checkRunI
5667 */
5768 public function allForCheckSuite (string $ username , string $ repository , int $ checkSuiteId , array $ params = [])
5869 {
70+ $ this ->acceptHeaderValue = 'application/vnd.github.antiope-preview+json ' ;
71+
5972 return $ this ->get ('/repos/ ' .rawurlencode ($ username ).'/ ' .rawurlencode ($ repository ).'/check-suites/ ' .$ checkSuiteId .'/check-runs ' , $ params );
6073 }
6174
@@ -66,6 +79,8 @@ public function allForCheckSuite(string $username, string $repository, int $chec
6679 */
6780 public function allForReference (string $ username , string $ repository , string $ ref , array $ params = [])
6881 {
82+ $ this ->acceptHeaderValue = 'application/vnd.github.antiope-preview+json ' ;
83+
6984 return $ this ->get ('/repos/ ' .rawurlencode ($ username ).'/ ' .rawurlencode ($ repository ).'/commits/ ' .rawurlencode ($ ref ).'/check-runs ' , $ params );
7085 }
7186}
0 commit comments