Closed pbstriker38 closed 10 months ago
@pbstriker38 I'm not sure this works with older versions of octokit
-- what do you think of bumping the dependency? Without verifying that it works, I'd be a bit hesitant to merge this as-is.
@ashkulz I did verify that it works with both versions. On Octokit 7.2.0 it sends both position
and line
params. The API ignores postion and uses line. On Octokit 8.0.0 the params are merged into the options and thus the line
is merged.
The other option I can do here is to not use Octokit#create_pull_comment
method and to just use Octokit#post
directly like so:
options = {
body: comment.body,
commit_id: pull_sha || comment.sha,
path: comment.path,
line: comment.position
}
client.post("#{Octokit::Repository.path(slug)}/pulls/#{pull_id}/comments", options)
I did not test earlier Octokit versions though. I can try and test those too.
Thanks for the contribution and being patient while we figured things out, @pbstriker38!
Fixes: #453