How to post non file-specific/commit specific comments to PRs

According to https://developer.github.com/v3/pulls/comments/#create-a-comment all parameters 

  1. commit_id
  2. path
  3. position

are required. But what do I have to pass if I want to add a generic PR comment (not related to a specific commit or path)? Can I just leave those parameters empty?

It would be nice if the documentation could be clarified in this regard.

Thanks,

Konrad

Hi @kwin,

 

I’m afraid leaving those params empty wouldn’t work. As far as I know you have to associate the comment when in a review stage. However, you can create a new comment.

Using GraphQL for example:

FindPullRequestID first

then AddPullRequestComment

query FindPullRequestID {
  repository(owner:"andreagriffiths11", name:"graphql-test") {
    pullRequest(number:1) {
      id
    }
  }
}

mutation AddPullRequestComment {
  addComment(input:{subjectId:"MDExOlB1bGxSZXF1ZXN0MjcwMjQwOTUw",body: "test generic comment"}) {
    commentEdge {
    	node {
        createdAt
        body
      }
    }
    subject {
      id
    }
  }
}

 I hope this helps!