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).

Image

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 ${{ secrets.name }} in action.

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

https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets

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

1 Like