3
3
namespace Github \Api \Repository \Checks ;
4
4
5
5
use Github \Api \AbstractApi ;
6
+ use Github \Api \AcceptHeaderTrait ;
6
7
7
8
/**
8
9
* @link https://docs.github.com/en/free-pro-team@latest/rest/reference/checks
9
10
*/
10
11
class CheckRuns extends AbstractApi
11
12
{
13
+ use AcceptHeaderTrait;
14
+
12
15
/**
13
16
* @link https://docs.github.com/en/free-pro-team@latest/rest/reference/checks#create-a-check-run
14
17
*
15
18
* @return array
16
19
*/
17
20
public function create (string $ username , string $ repository , array $ params = [])
18
21
{
22
+ $ this ->acceptHeaderValue = 'application/vnd.github.antiope-preview+json ' ;
23
+
19
24
return $ this ->post ('/repos/ ' .rawurlencode ($ username ).'/ ' .rawurlencode ($ repository ).'/check-runs ' , $ params );
20
25
}
21
26
@@ -26,6 +31,8 @@ public function create(string $username, string $repository, array $params = [])
26
31
*/
27
32
public function show (string $ username , string $ repository , int $ checkRunId )
28
33
{
34
+ $ this ->acceptHeaderValue = 'application/vnd.github.antiope-preview+json ' ;
35
+
29
36
return $ this ->get ('/repos/ ' .rawurlencode ($ username ).'/ ' .rawurlencode ($ repository ).'/check-runs/ ' .$ checkRunId );
30
37
}
31
38
@@ -36,6 +43,8 @@ public function show(string $username, string $repository, int $checkRunId)
36
43
*/
37
44
public function update (string $ username , string $ repository , int $ checkRunId , array $ params = [])
38
45
{
46
+ $ this ->acceptHeaderValue = 'application/vnd.github.antiope-preview+json ' ;
47
+
39
48
return $ this ->patch ('/repos/ ' .rawurlencode ($ username ).'/ ' .rawurlencode ($ repository ).'/check-runs/ ' .$ checkRunId , $ params );
40
49
}
41
50
@@ -46,6 +55,8 @@ public function update(string $username, string $repository, int $checkRunId, ar
46
55
*/
47
56
public function annotations (string $ username , string $ repository , int $ checkRunId )
48
57
{
58
+ $ this ->acceptHeaderValue = 'application/vnd.github.antiope-preview+json ' ;
59
+
49
60
return $ this ->get ('/repos/ ' .rawurlencode ($ username ).'/ ' .rawurlencode ($ repository ).'/check-runs/ ' .$ checkRunId .'/annotations ' );
50
61
}
51
62
@@ -56,6 +67,8 @@ public function annotations(string $username, string $repository, int $checkRunI
56
67
*/
57
68
public function allForCheckSuite (string $ username , string $ repository , int $ checkSuiteId , array $ params = [])
58
69
{
70
+ $ this ->acceptHeaderValue = 'application/vnd.github.antiope-preview+json ' ;
71
+
59
72
return $ this ->get ('/repos/ ' .rawurlencode ($ username ).'/ ' .rawurlencode ($ repository ).'/check-suites/ ' .$ checkSuiteId .'/check-runs ' , $ params );
60
73
}
61
74
@@ -66,6 +79,8 @@ public function allForCheckSuite(string $username, string $repository, int $chec
66
79
*/
67
80
public function allForReference (string $ username , string $ repository , string $ ref , array $ params = [])
68
81
{
82
+ $ this ->acceptHeaderValue = 'application/vnd.github.antiope-preview+json ' ;
83
+
69
84
return $ this ->get ('/repos/ ' .rawurlencode ($ username ).'/ ' .rawurlencode ($ repository ).'/commits/ ' .rawurlencode ($ ref ).'/check-runs ' , $ params );
70
85
}
71
86
}
0 commit comments