Issue
I have an app that I want to bump versions on during the CI build. I'm trying to push the version bump back using the apps credentials but its getting these errors:
+ git push origin HEAD:master
remote: error: GH006: Protected branch update failed for refs/heads/master.
remote: error: At least 1 approving review is required by reviewers with write access.
Now when I do it with my own credentials it works because I am an admin in the repo but how can I grant access to an App to push to master despite the usual branch protections?
Solution
You cant. The branch permissions are there to stop anyone from pushing to the branch.
In my setup we have protection from admins pushing too which is even more fun. We have got around it with two service accounts, in the CI code we raise a PR using one service accounts token and then imeditatly the other accounts token approves and merges it
It's not a great workaround but untill GitHub make finer grained permissions it is all we can do
Answered By - apr_1985
Answer Checked By - Senaida (JavaFixing Volunteer)