When a developer edits a reviewer's approval comment, gh api .../reviews doesn't show it. Any other way to catch it? #7892
Unanswered
Bikram-DoorDash
asked this question in
Q&A
Replies: 1 comment 1 reply
-
|
@bikram-agarwal I don't think you can do what you are asking using the REST API but using the GraphQL API https://docs.github.com/en/graphql/reference/objects#pullrequestreview I think you should be able to. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm building an automation tool where a PR is allowed to merge during work-hours if a manager approved the PR, along with a comment saying "EMERGENCY". If the comment in that approval doesn't say "EMERGENCY", the tool will block the PR from merging.
For this, I was using this command -
gh api repos/myorg/myrepo/pulls/22297/reviews --jq '.[] | select (.state == "APPROVED") | .user.login,.body'i.e. selecting any review where approval is given, and getting the reviewer's id and the approval comment from that.
But I noticed that everyone is allowed to edit everyone's comment. So, a developer can edit the manager's comment to say EMERGENCY. The GitHub UI does show this edit.
But the
gh api repos/myorg/myrepo/pulls/22297/reviewscommand doesn't show the edit at all.Thus, I have no way of knowing via this command that the approver's comment was edited by someone else.
Is there any other gh command or any other endpoint that can help in this scenario?
Beta Was this translation helpful? Give feedback.
All reactions