Skip to content

How to let actions-user to push to the repo #27217

Discussion options

You must be logged in to vote

You should be able to use the “Restrict who can push to matching branches” setting to exclude people from the protected branch rules. Unfortunately you’re only able to select user accounts here so you aren’t able to select the Actions bot directly.

To get around this you’ll need to select a user that has write access to the repository. Then you’ll need to create a Personal Access Token for this user, pass that into your workflow as a secret, and then use it in place of the default Actions token.

I believe that should then give your Actions workflow permission to push back to your repository’s protected branch while blocking other users from doing so.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants