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 f68d4aa

Browse filesBrowse files
committed
[CheckRun] Add ability to access HEAD SHA
1 parent 888abc9 commit f68d4aa
Copy full SHA for f68d4aa

File tree

Expand file treeCollapse file tree

2 files changed

+12
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+12
-1
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
+11-1Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import java.net.URL;
77

88
/**
9-
* Represents a deployment
9+
* Represents a check run.
1010
*
1111
* @see <a href="https://developer.github.com/v3/checks/runs/">documentation</a>
1212
*/
@@ -20,6 +20,7 @@ public class GHCheckRun extends GHObject {
2020
private String status;
2121
private String conclusion;
2222
private String name;
23+
private String headSha;
2324
private GHPullRequest[] pullRequests;
2425

2526
GHCheckRun wrap(GHRepository owner) {
@@ -52,6 +53,15 @@ public String getName() {
5253
return name;
5354
}
5455

56+
/**
57+
* Gets the HEAD SHA.
58+
*
59+
* @return sha for the HEAD commit
60+
*/
61+
public String getHeadSha() {
62+
return headSha;
63+
}
64+
5565
GHPullRequest[] getPullRequests() throws IOException {
5666
if (pullRequests != null && pullRequests.length != 0) {
5767
for (GHPullRequest singlePull : pullRequests) {

‎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
@@ -314,6 +314,7 @@ public void checkRunEvent() throws Exception {
314314
assertThat(event.getRepository().getName(), is("Hello-World"));
315315
assertThat(event.getAction(), is("created"));
316316
assertThat(event.getCheckRun().getName(), is("Octocoders-linter"));
317+
assertThat(event.getCheckRun().getHeadSha(), is("ec26c3e57ca3a959ca5aad62de7213c562f8c821"));
317318
}
318319

319320
}

0 commit comments

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