Skip to content

Commit 5a48a92

Browse files
committed
#1072: read commit_id from underlying JSON in Event.Smart.commitId()
Replaces the stub with Optional.fromNullable(event.json().getString( "commit_id", null)). When the GitHub API response includes a non-null commit_id, the method now returns Optional.of(sha); otherwise (null value or missing key) it returns Optional.absent(), matching the documented Issue Events payload at developer.github.com/v3/issues/events.
1 parent a4af26b commit 5a48a92

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/main/java/com/jcabi/github/Event.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,9 @@ public Date createdAt() throws IOException {
233233
* @since 1.7.0
234234
*/
235235
public Optional<String> commitId() throws IOException {
236-
return Optional.absent();
236+
return Optional.fromNullable(
237+
this.event.json().getString("commit_id", null)
238+
);
237239
}
238240

239241
/**

0 commit comments

Comments
 (0)