Skip to content

Commit 0f36d5a

Browse files
jemershawldelossa
authored andcommitted
fix: addPullRequestReviewComment is deprecated as of 2023-10-01 UTC
switched to use addPullRequestReviewThread
1 parent 2b55516 commit 0f36d5a

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

lua/litee/gh/ghcli/graphql.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ mutation ($pull: ID!, $review: ID!, $commit: GitObjectID!, $body: String!, $repl
1515
]]
1616

1717
M.create_comment_review = [[
18-
mutation ($pull: ID!, $review: ID!, $body: String!, $path: String!, $pos: Int!, $sha: GitObjectID!) {
19-
addPullRequestReviewComment(
20-
input: {pullRequestId: $pull, pullRequestReviewId: $review, body: $body, path: $path, position: $pos, commitOID: $sha}
18+
mutation ($pull: ID!, $review: ID!, $body: String!, $path: String!, $line: Int!, $side: DiffSide!) {
19+
addPullRequestReviewThread(
20+
input: {pullRequestId: $pull, pullRequestReviewId: $review, body: $body, path: $path, line: $line, side: $side}
2121
) {
2222
clientMutationId
2323
}

lua/litee/gh/ghcli/init.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -575,14 +575,14 @@ end
575575

576576
-- this is a graphql query so pass use the node_id for each argument that wants
577577
-- and id.
578-
function M.create_comment_review(pull_id, review_id, body, path, pos, sha)
579-
local cmd = string.format([[gh api graphql -F pull="%s" -F review="%s" -F body=%s -F path="%s" -F pos=%d -F sha="%s" -f query='%s']],
578+
function M.create_comment_review(pull_id, review_id, body, path, line, side)
579+
local cmd = string.format([[gh api graphql -F pull="%s" -F review="%s" -F body=%s -F path="%s" -F line=%d -F side=%s -f query='%s']],
580580
pull_id,
581581
review_id,
582582
body,
583583
path,
584-
pos,
585-
sha,
584+
line,
585+
side,
586586
graphql.create_comment_review
587587
)
588588
local resp = gh_exec(cmd)

0 commit comments

Comments
 (0)