Replies: 98 comments 86 replies
-
Also mentioned and requested here: https://github.community/t/allowing-github-actions-bot-to-push-to-protected-branch/16536 |
BetaWas this translation helpful?Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Even though it wouldn't work in all use cases for all people, treating the E.g. at my company the |
BetaWas this translation helpful?Give feedback.
-
BetaWas this translation helpful?Give feedback.
-
Just encountered this exact issue. This is certainly great to have for smaller hobby teams as well where you don't really want nor need to setup whole delivery pipelines. |
BetaWas this translation helpful?Give feedback.
-
Yes, GitHub, let's get this feature in please. |
BetaWas this translation helpful?Give feedback.
-
Would also like this implemented. 👍 |
BetaWas this translation helpful?Give feedback.
-
That would be a great GA to implement! |
BetaWas this translation helpful?Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
+1 I had to implement a walkaround to cater for such requirements which I do not encourage following... Update: If you're very keen, you can see multiple ideas/solutions posted across the board linking to this issue. |
BetaWas this translation helpful?Give feedback.
-
does this fit your need ? https://github.blog/changelog/2022-08-18-bypass-branch-protections-with-a-new-permission/ |
BetaWas this translation helpful?Give feedback.
-
Also interested in a solution - I'm trying to auto bump the version but the branch protection rule I have on |
BetaWas this translation helpful?Give feedback.
-
Also looking for a solution! I have a python-black formatter that pushes code to the main branch but the protection rules won't allow it |
BetaWas this translation helpful?Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm running into this issue as well. I use |
BetaWas this translation helpful?Give feedback.
-
Can we bypass the permission rules with Gitbook? We are facing the same issue but within the same company (!) |
BetaWas this translation helpful?Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
As a simplification of the "service user" approach outlined by the OP: for the commit(s) pushed by the "service user", one can consider using |
BetaWas this translation helpful?Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Github, this is a need for full automation after deploys. PLEASE consider this soon. |
BetaWas this translation helpful?Give feedback.
-
+1 |
BetaWas this translation helpful?Give feedback.
-
Your critique of the common workarounds is fair: PATs and bot users are clunky; letting raw GITHUB_TOKEN bypass would be dangerous.The checkbox idea is good in spirit-it expresses the least-privilege intent you want-but it would need a few guardrails (see below), otherwise it recreates the very risks branch protection exists to mitigate. First, I can think of some issues with the raw idea:
If GitHub would be designing such checkbox, I'd insist on all of these guardrails:
So, I can see why this isn't Github priority ATM. But I'd vouch for it. |
BetaWas this translation helpful?Give feedback.
-
+1 |
BetaWas this translation helpful?Give feedback.
-
+1 |
BetaWas this translation helpful?Give feedback.
-
+1 |
BetaWas this translation helpful?Give feedback.
-
+1 |
BetaWas this translation helpful?Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Use deploy keys... Add a ruleset override on deploy keys. Get secret value in workflow, perform your git a actions using the key. I have had some issues getting the key to work, but you just need to enforce the key to use in the GitHub command. I think I exported the GitHub command to a var the ran it with shh key defined. I can verify it then allows read and write if yous et it on the key to the repo if override allowed on ruleset. If you get permission denied it's this problem. There is some issue with workflow using the deploy key in the git command so you have to mess a bit to get it going. GIT_SSH_COMMAND="ssh -i github_actions_deploy_key -o IdentitiesOnly=yes -o StrictHostKeyChecking=no" git push origin develop That's what worked for me, no joy with a single CMD but exporting and calling git worked in workflow. |
BetaWas this translation helpful?Give feedback.
-
Ok |
BetaWas this translation helpful?Give feedback.
-
+1 |
BetaWas this translation helpful?Give feedback.
-
+1 |
BetaWas this translation helpful?Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
What is about? …On Tue, 11 Nov 2025 at 11:29, zinzoch ***@***.***> wrote: What is the problem ask your capitol Sent from [Proton Mail](https://proton.me/mail/home) for Android. -------- Original Message -------- On Monday, 11/10/25 at 16:57 sherbakovdev ***@***.***> wrote: > +1 > > — > Reply to this email directly, [view it on GitHub]( #13836 (comment)), or [unsubscribe]( https://github.com/notifications/unsubscribe-auth/BZQTMBA4CHLHRRQR5CTJ7LT34CYVVAVCNFSM5SAQI6N2U5DIOJSWCZC7NNSXTOSENFZWG5LTONUW63SDN5WW2ZLOOQ5TCNBZGI3DGNBY ). > You are receiving this because you are subscribed to this thread.Message ID: ***@***.***> — Reply to this email directly, view it on GitHub <#13836 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/BOK7YDJ5WUUHUNSST6D6BIL34HCC7AVCNFSM5SAQI6N2U5DIOJSWCZC7NNSXTOSENFZWG5LTONUW63SDN5WW2ZLOOQ5TCNBZGM2TOOBW> . You are receiving this because you commented.Message ID: ***@***.***> |
BetaWas this translation helpful?Give feedback.
-
+2 …On Tue, 11 Nov 2025 at 11:22, Roberto Jiménez Sánchez < ***@***.***> wrote: +1 — Reply to this email directly, view it on GitHub <#13836 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/BOK7YDPUVPYSWI6GJU7BTZL34HBJFAVCNFSM5SAQI6N2U5DIOJSWCZC7NNSXTOSENFZWG5LTONUW63SDN5WW2ZLOOQ5TCNBZGM2TONBW> . You are receiving this because you commented.Message ID: ***@***.***> |
BetaWas this translation helpful?Give feedback.
-
💬 Your Product Feedback Has Been Submitted 🎉 Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. Here's what you can expect moving forward ⏩
Where to look to see what's shipping 👀
What you can do in the meantime 💻
As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ |
BetaWas this translation helpful?Give feedback.
-
Thank you for your response. …On Fri, 28 Nov 2025 at 16:51, github-actions[bot] ***@***.***> wrote: *💬 Your Product Feedback Has Been Submitted 🎉* Thank you for taking the time to share your insights with us! Your feedback is invaluable as we build a better GitHub experience for all our users. *Here's what you can expect moving forward ⏩* - Your input will be carefully reviewed and cataloged by members of our product teams. - Due to the high volume of submissions, we may not always be able to provide individual responses. - Rest assured, your feedback will help chart our course for product improvements. - Other users may engage with your post, sharing their own perspectives or experiences. - GitHub staff may reach out for further clarification or insight. - We may 'Answer' your discussion if there is a current solution, workaround, or roadmap/changelog post related to the feedback. *Where to look to see what's shipping 👀* - Read the Changelog <https://github.blog/changelog/> for real-time updates on the latest GitHub features, enhancements, and calls for feedback. - Explore our Product Roadmap <https://github.com/orgs/github/projects/4247>, which details upcoming major releases and initiatives. *What you can do in the meantime 💻* - Upvote and comment on other user feedback Discussions that resonate with you. - Add more information at any point! Useful details include: use cases, relevant labels, desired outcomes, and any accompanying screenshots. As a member of the GitHub community, your participation is essential. While we can't promise that every suggestion will be implemented, we want to emphasize that your feedback is instrumental in guiding our decisions and priorities. Thank you once again for your contribution to making GitHub even better! We're grateful for your ongoing support and collaboration in shaping the future of our platform. ⭐ — Reply to this email directly, view it on GitHub <#13836 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/BOK7YDKISI4LAVJTZZOJRTL37B4P5AVCNFSM5SAQI6N2U5DIOJSWCZC7NNSXTOSENFZWG5LTONUW63SDN5WW2ZLOOQ5TCNJRGA3TIMJX> . You are receiving this because you commented.Message ID: ***@***.***> |
BetaWas this translation helpful?Give feedback.



Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
There are workflows in which it is desirable to have the workflow itself make changes (such as updating a
pom.xml,packages.json,CHANGELOG.md, etc.) on a branch which is otherwise protected from direct changes.Some things that don't work (or don't work well):
GITHUB_TOKENto the "Restrict who can push to matching branches" list, but even if it were this wouldn't be a useful solution, because then any action from any branch could bypass the branch protection rules, making them too easily circumventable.pushevents to make sure that they ignore any commits pushed by the service user (the way they'd ignore commits pushed usingGITHUB_TOKEN). This more-or-less works, but it's a lot of work to replicate this set up across dozens of repositories, and it's really abusing a bunch of unrelated functionality for something that should be available out of the box.My proposed solution is to add a checkbox under Branch Protection rules, "Allow Github Actions workflows run from matching branches to push commits back to the same branch". Checking this box would have two effects:
pushevents to the protected branch (which, given the branch is protected, will generally represent pull-request merges rather than remote pushes) will be allowed to push additional commits back to the protected branch as if they were being pushed by an individual user who was listed under "Restrict who can push to matching branches".workflow_dispatchevent, where the workflow was dispatched from the protected branch (i.e. the workflow YAML file being executed is read from the protected branch) will be allowed to push additional commits back to the protected branch as if they were being pushed by an individual who was listed under "Restrict who can push to matching branches".Note that in both cases, the workflow should only be permitted to push commits back to the same branch that the workflow is being executed from (or other, unprotected branches, as is already possible). A workflow should not be able to push commits to any other protected branch, not even a distinct branch that matches the same branch protection rule.
This feature request is inspired by a long-running discussion in the Github Community discussion boards; I felt it was worth bringing a concrete feature request to this Feedback repository, at this point.
NOTE: If you want to show your support for this feature request, please upvote it using the upvote button

rather than replying with a "+1". Replies like that just result in sending spam to everyone else interested in the issue, and importantly, don't even "count" when it comes to how much GitHub will prioritize the issue. They're just spam, they're not spam that also counts as a vote in any way.
BetaWas this translation helpful?Give feedback.
All reactions