Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2242174

Browse filesBrowse files
committed
add Output in GHCheckRun
1 parent 05e8148 commit 2242174
Copy full SHA for 2242174

File tree

Expand file treeCollapse file tree

3 files changed

+43
-3
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+43
-3
lines changed

‎src/main/java/org/kohsuke/github/GHCheckRun.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHCheckRun.java
+41-2Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ public class GHCheckRun extends GHObject {
2828
private URL url;
2929
private URL htmlUrl;
3030
private URL detailsUrl;
31+
private Output output;
3132
private GHApp app;
3233
private GHPullRequest[] pullRequests;
3334

34-
// TODO: Add Output object, Check Suite object
35+
// TODO: Add Check Suite object
3536

3637
GHCheckRun wrap(GHRepository owner) {
3738
this.owner = owner;
@@ -173,9 +174,47 @@ public String getCompletedAt() {
173174
/**
174175
* Gets the GitHub app this check run belongs to, included in response.
175176
*
176-
* @retrurn GitHub App
177+
* @return GitHub App
177178
*/
178179
public GHApp getApp() {
179180
return app;
180181
}
182+
183+
public Output getOutput() {
184+
return output;
185+
}
186+
187+
/**
188+
* Represents an output in a check run to include summary and other results.
189+
*
190+
* @see <a href="https://developer.github.com/v3/checks/runs/#output-object">documentation</a>
191+
*/
192+
public static class Output {
193+
private String title;
194+
private String summary;
195+
private String text;
196+
private int annotationsCount;
197+
private URL annotationsUrl;
198+
199+
public String getTitle() {
200+
return title;
201+
}
202+
203+
public String getSummary() {
204+
return summary;
205+
}
206+
207+
public String getText() {
208+
return text;
209+
}
210+
211+
public int getAnnotationsCount() {
212+
return annotationsCount;
213+
}
214+
215+
public URL getAnnotationsUrl() {
216+
return annotationsUrl;
217+
}
218+
}
219+
181220
}

‎src/test/java/org/kohsuke/github/GHEventPayloadTest.java

Copy file name to clipboardExpand all lines: src/test/java/org/kohsuke/github/GHEventPayloadTest.java
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ public void checkRunEvent() throws Exception {
338338
assertThat(checkRun.getHtmlUrl().toString(), is("https://github.com/Codertocat/Hello-World/runs/128620228"));
339339
assertThat(checkRun.getDetailsUrl().toString(), is("https://octocoders.io"));
340340
assertThat(checkRun.getApp().getId(), is(29310L));
341+
assertThat(checkRun.getOutput().getTitle(), is("check-run output"));
341342

342343
// Checks the deserialization of sender
343344
assertThat(event.getSender().getId(), is(21031067L));

‎src/test/resources/org/kohsuke/github/GHEventPayloadTest/check-run.json

Copy file name to clipboardExpand all lines: src/test/resources/org/kohsuke/github/GHEventPayloadTest/check-run.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"started_at": "2019-05-15T15:21:12Z",
1414
"completed_at": "2019-05-15T20:22:22Z",
1515
"output": {
16-
"title": null,
16+
"title": "check-run output",
1717
"summary": null,
1818
"text": null,
1919
"annotations_count": 0,

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.