Skip to content

Commit 2758ac7

Browse files
committed
Add update_check_run endpoint
1 parent ed3c915 commit 2758ac7

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ GitHub.jl implements a bunch of methods that make REST requests to GitHub's API.
222222
| method | return type | documentation |
223223
|------------------------------------------|------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
224224
| `create_check_run(repo; params=...)` | `CheckRun` | [Create a new check run](https://developer.github.com/v3/checks/runs/#create-a-check-run) |
225+
| `update_check_run(repo, id::Int; params=...)` | `CheckRun` | [Update the check run with the given `id`](https://developer.github.com/v3/checks/runs/#update-a-check-run) |
225226

226227

227228
#### Miscellaneous

src/GitHub.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,8 @@ export # installations.jl
257257

258258
export # runs.jl
259259
Checks,
260-
create_check_run
260+
create_check_run,
261+
update_check_run
261262

262263
#######
263264
# Git #

src/apps/checks/runs.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ struct CheckRun <: GitHubType
4444
started_at::Nullable{DateTime}
4545
completed_at::Nullable{DateTime}
4646
app::Nullable{App}
47-
pull_requests::Vector{PullRequest}
47+
pull_requests::Nullable{Vector{PullRequest}}
4848
end
4949
CheckRun(data::Dict) = json2github(CheckRun, data)
5050
namefield(cr::CheckRun) = cr.id
@@ -54,3 +54,9 @@ namefield(cr::CheckRun) = cr.id
5454
result = gh_post_json(api, "/repos/$(name(repo))/check-runs"; headers=headers, kwargs...)
5555
return CheckRun(result)
5656
end
57+
58+
@api_default function update_check_run(api::GitHubAPI, repo::Repo, id::Int; headers = Dict(), kwargs...)
59+
headers["Accept"] = "application/vnd.github.antiope-preview+json"
60+
result = gh_patch_json(api, "/repos/$(name(repo))/check-runs/$(id)"; headers=headers, kwargs...)
61+
return CheckRun(result)
62+
end

0 commit comments

Comments
 (0)