Skip to content

Commit 504516e

Browse files
authored
Update ListCheckRunsOptions with new field AppID (#2236)
Fixes #2231.
1 parent 46ababc commit 504516e

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

github/checks.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ type ListCheckRunsOptions struct {
234234
CheckName *string `url:"check_name,omitempty"` // Returns check runs with the specified name.
235235
Status *string `url:"status,omitempty"` // Returns check runs with the specified status. Can be one of "queued", "in_progress", or "completed".
236236
Filter *string `url:"filter,omitempty"` // Filters check runs by their completed_at timestamp. Can be one of "latest" (returning the most recent check runs) or "all". Default: "latest"
237+
AppID *int64 `url:"app_id,omitempty"` // Filters check runs by GitHub App ID.
237238

238239
ListOptions
239240
}

github/checks_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ func TestChecksService_ListCheckRunsForRef(t *testing.T) {
319319
"page": "1",
320320
"status": "completed",
321321
"filter": "all",
322+
"app_id": "1",
322323
})
323324
fmt.Fprint(w, `{"total_count":1,
324325
"check_runs": [{
@@ -327,14 +328,17 @@ func TestChecksService_ListCheckRunsForRef(t *testing.T) {
327328
"status": "completed",
328329
"conclusion": "neutral",
329330
"started_at": "2018-05-04T01:14:52Z",
330-
"completed_at": "2018-05-04T01:14:52Z"}]}`,
331+
"completed_at": "2018-05-04T01:14:52Z",
332+
"app": {
333+
"id": 1}}]}`,
331334
)
332335
})
333336

334337
opt := &ListCheckRunsOptions{
335338
CheckName: String("testing"),
336339
Status: String("completed"),
337340
Filter: String("all"),
341+
AppID: Int64(1),
338342
ListOptions: ListOptions{Page: 1},
339343
}
340344
ctx := context.Background()
@@ -352,6 +356,7 @@ func TestChecksService_ListCheckRunsForRef(t *testing.T) {
352356
CompletedAt: &Timestamp{startedAt},
353357
Conclusion: String("neutral"),
354358
HeadSHA: String("deadbeef"),
359+
App: &App{ID: Int64(1)},
355360
}},
356361
}
357362

github/github-accessors.go

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/github-accessors_test.go

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)