@@ 79-86 (lines=8) @@ | ||
76 | * |
|
77 | * @return array |
|
78 | */ |
|
79 | public function updateFile(string $path, string $message, string $content, string $sha, |
|
80 | string $branch = AbstractApi::BRANCH_MASTER): array |
|
81 | { |
|
82 | return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/contents/:path?:args', |
|
83 | $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $path, |
|
84 | http_build_query(['message' => $message, 'content' => $content, 'sha' => $sha, 'branch' => $branch])), |
|
85 | Request::METHOD_PUT); |
|
86 | } |
|
87 | ||
88 | /** |
|
89 | * Delete a file |
@@ 54-63 (lines=10) @@ | ||
51 | * |
|
52 | * @return array |
|
53 | */ |
|
54 | public function createHook(string $name, string $config, array $events = ['push'], bool $active = true): array |
|
55 | { |
|
56 | return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/hooks', |
|
57 | $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo()), Request::METHOD_POST, [ |
|
58 | 'name' => $name, |
|
59 | 'config' => $config, |
|
60 | 'events' => $events, |
|
61 | 'active' => $active |
|
62 | ]); |
|
63 | } |
|
64 | ||
65 | /** |
|
66 | * Edit a hook |
@@ 28-38 (lines=11) @@ | ||
25 | * |
|
26 | * @return array |
|
27 | */ |
|
28 | public function createStatus(string $sha, string $state, string $targetUrl = null, string $description = null, |
|
29 | string $context = 'default'): array |
|
30 | { |
|
31 | return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/statuses/:sha', |
|
32 | $this->getRepositories()->getOwner(), $this->getRepositories()->getRepo(), $sha), Request::METHOD_POST, [ |
|
33 | 'state' => $state, |
|
34 | 'target_url' => $targetUrl, |
|
35 | 'description' => $description, |
|
36 | 'context' => $context |
|
37 | ]); |
|
38 | } |
|
39 | ||
40 | /** |
|
41 | * List Statuses for a specific Ref |