Bot "github-actions" not allowed to comment locked PR

I experienced following behaviour and didn’t know where I should open an issue.

I’m using an action that runs on PR and comments back with some information at same PR. While PR is unlocked everything works fine. When I’m locking PR only contributors are allowed to take part in the conversation (= creating comments). This behaviour works well for human users but I would have expected technical users like github-actions bot being able to create comments in locked state.

Technical users are configured and maintained by contributors so I understand them as “deputies” and think they should have contributor rights (at least for commenting).

What do you think? If you agree: where should I file an issue?

Example: between locking and unlocking PR in the image below I did same action and expected a comment just like the other ones (source).


Sorry for the delay response. When you use GITHUB_TOKEN , all of the interactions with the repository are on behalf of the Github-actions bot.

Github-actions bot doesn’t have enough permission to create comments in locked pull request.  

According to the message : You and other members of teams with write access to this repository can still leave comments that others can see.

lock pr.png

As a work around, I would suggest you to use your own PAT in the action for adding comment to Pull request. You can store your PAT in secrets and use ${{ }} in action.

For Creating and using encrypted secrets, please refer to this document:

In pull request page , you will see that it is you add a comment.

1 Like