Skip to content

Commit

Permalink
try file subject
Browse files Browse the repository at this point in the history
  • Loading branch information
YajJackson committed Mar 20, 2024
1 parent a4d0b94 commit fc345d5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31506,7 +31506,8 @@ Message: ${diagnostic.message}`;
commit_id: pullRequest.head.sha,
path: relativePath,
side: "RIGHT",
line: diagnostic.range.start.line,
subject_type: "file",
line: diagnostic.range.end.line,
body
});
}
Expand Down
6 changes: 5 additions & 1 deletion src/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,9 @@ async function commentOnPR(
pullRequest.base.repo.name,
);

// This can throw: {"resource":"PullRequestReviewComment","code":"custom","field":"pull_request_review_thread.line","message":"pull_request_review_thread.line must be part of the diff"}

// https://github.com/YajJackson/example-python-project/pull/2/review_comment/create
core.info("Creating comment for file: " + relativePath);
await octokit.rest.pulls.createReviewComment({
owner: context.repo.owner,
Expand All @@ -126,7 +129,8 @@ async function commentOnPR(
commit_id: pullRequest.head.sha,
path: relativePath,
side: "RIGHT",
line: diagnostic.range.start.line,
subject_type: "file",
line: diagnostic.range.end.line,
body,
});
}
Expand Down

0 comments on commit fc345d5

Please sign in to comment.