Note that, if the PR comes from a fork, it will have only read permission despite the permissions given in the action for the pull_request event. In this case, you may use the pull_request_target event. With this event, permissions can be given without issue (the difference is that it will execute the action from the target branch and not from the origin PR).
This is required to make the comments work on PRs coming from a fork
Cf. https://github.com/marketplace/actions/comment-pull-request: