From 59b5cf31edd0e089d54c89b1a47693f76d816a4a Mon Sep 17 00:00:00 2001 From: Luke Evers Date: Thu, 3 Mar 2016 18:16:28 -0500 Subject: [PATCH] Add InReplyTo to PullRequestComment struct In V3 of the GitHub API, pull request comments are created in two ways. The first way is to create a comment on a specific line of a file in a commit with the following parameters: | Name | Type | Description | |-----------|---------|--------------------------------------------------------| | body | string | Required. The text of the comment | | commit_id | string | Required. The SHA of the commit to comment on. | | path | string | Required. The relative path of the file to comment on. | | position | integer | Required. The line index in the diff to comment on. | And the second way is through a reply to an existing comment with the following parameters: | Name | Type | Description | |-------------|---------|---------------------------------------| | body | string | Required. The text of the comment | | in_reply_to | integer | Required. The comment id to reply to. | This commit adds support for the second (or "Alternative Input" according to the GitHub docs) way. --- github/pulls_comments.go | 1 + 1 file changed, 1 insertion(+) diff --git a/github/pulls_comments.go b/github/pulls_comments.go index 10d2a64..0b7e13b 100644 --- a/github/pulls_comments.go +++ b/github/pulls_comments.go @@ -13,6 +13,7 @@ import ( // PullRequestComment represents a comment left on a pull request. type PullRequestComment struct { ID *int `json:"id,omitempty"` + InReplyTo *int `json:"in_reply_to,omitempty"` Body *string `json:"body,omitempty"` Path *string `json:"path,omitempty"` DiffHunk *string `json:"diff_hunk,omitempty"`