automatic-pull-request-review
automatic-pull-request-review copied to clipboard
DISMISS doesn't work
It seems that the addPullRequestReview mutation doesn't support DISMISS. I think this is a GitHub bug and not a problem in the action itself. But as a result the action is broken. You can check this with the following queries in https://docs.github.com/en/graphql/overview/explorer:
query get_pr_id {
repository(owner: "Ana06", name: "capa") {
pullRequest(number: 2) {
id
number
title
}
}
}

mutation add_review {
addPullRequestReview(input: {
pullRequestId: "MDExOlB1bGxSZXF1ZXN0NTk3NzMyNTAx",
event: REQUEST_CHANGES,
body: "I request changes!"}
) { clientMutationId }
}

mutation dismiss_review {
addPullRequestReview(input: {
pullRequestId: "MDExOlB1bGxSZXF1ZXN0NTk3NzMyNTAx",
event: DISMISS,
body: "I don't request changes!"}) {
clientMutationId
}
}

I reported it to GitHub 9 days ago. GitHub support has told me to use the dismisspullrequestreview mutation. They are still looking into it, so it might be that they fix addPullRequestReview to support DISMISS. Otherwise we could update the code to use dismisspullrequestreview, as it seems to be working properly. I can send a PR after https://github.com/AndrewMusgrave/automatic-pull-request-review/pull/47 (to avoid merge conflicts).
I have released Ana06/[email protected] which fixes this and includes https://github.com/AndrewMusgrave/automatic-pull-request-review/pull/47: https://github.com/Ana06/automatic-pull-request-review/compare/0.0.5...v0.1.0