Skip to content
This repository has been archived by the owner on Mar 27, 2023. It is now read-only.

Set Default PR Branch to Devel Branch #16

Open
tajmone opened this issue Nov 7, 2022 · 2 comments
Open

Set Default PR Branch to Devel Branch #16

tajmone opened this issue Nov 7, 2022 · 2 comments

Comments

@tajmone
Copy link
Contributor

tajmone commented Nov 7, 2022

I noticed that whenever I create a PR via GH WebUI it defaults to creating it against main branch.

If you could tweak settings so that all PRs would default to the develop branch instead of main (without precluding the option to PR against main though) it would be much better, since once a PR is created it's not possible to change its target branch without deleting the PR and creating a new one from scratch. The idea is to prevent PRs accidentally targeting main when they were intended for develop, since it's easy to overlook this via the WebUI.

I'm not sure how you can do this without affecting the default branch — the default branch should be main, not develop. If there isn't a specific setting for the default pull-request branch, you might try to block PRs on main via the branch protection settings, as a last resort (although I think that creating a PR against main should be kept an open option, although not the default).

@pml-lang
Copy link
Owner

pml-lang commented Nov 8, 2022

tweak settings so that all PRs would default to the develop branch instead of main (without precluding the option to PR against main though)

It seams that this is not (yet?) supported in GitHub. I couldn't find an option in the settings, and other people seem to have the same request, but no solution, as can be seen here and here.

you might try to block PRs on main via the branch protection settings.

Yes, that's supported. There is a checkbox labeled "Lock branch. Branch is read-only. Users cannot push to the branch."
But then nobody can make a PR to branch main, unless the checkbox is temporarily unchecked.

Do you want me to do that?

@tajmone
Copy link
Contributor Author

tajmone commented Nov 8, 2022

Yes, that's supported. There is a checkbox labeled "Lock branch. Branch is read-only. Users cannot push to the branch."
But then nobody can make a PR to branch main, unless the checkbox is temporarily unchecked.

Turning main into read-only seems a bit extreme, it might also prevent other operations.

Do you want me to do that?

Probably not, since there isn't a proper option to do so. The only goal was to prevent PR ending up targeting the main branch by default, since IMO I've seen that it often leads to PRs that need to be recreated. But lacking a proper option to handle this, I suggest avoiding fiddling with settings which we might later regret.

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

No branches or pull requests

2 participants