Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

protected main branch support? #35

Open
nrbnlulu opened this issue Jan 31, 2023 · 1 comment
Open

protected main branch support? #35

nrbnlulu opened this issue Jan 31, 2023 · 1 comment

Comments

@nrbnlulu
Copy link

remote: error: GH006: Protected branch update failed for refs/heads/main.        
remote: error: Changes must be made through a pull request.     

https://github.com/nrbnlulu/qtgql/actions/runs/4051372691/jobs/6969636236

@justinmayer
Copy link
Collaborator

You can still have a protected main branch in an AutoPub context, in which force-pushing to and deletion of the primary branch are not allowed. No problems there at all.

But requiring all commits to be made to a non-protected branch and then submitted via a pull request, on the other hand, will not work with the current flow because AutoPub needs to be able to make and push commits directly to the primary branch.

To fix this, remove the requirement that all commits to the primary branch must be made in the form of pull requests:

https://github.com/ORG-NAME/REPO-NAME/settings/branches → Branch protection rules → main → Edit → un-check: Require a pull request before merging

There may be a way to use the GitHub API to automatically create a pull request and then immediately merge that pull request. Perhaps when the extensible plugin system work by @patrick91 has been merged, you could write a plugin that handles that kind of automated PR+merge flow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants