8000 Enforce that PRs are not opened from the 'master' branch of a fork by emilk · Pull Request #6899 · emilk/egui · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Enforce that PRs are not opened from the 'master' branch of a fork #6899

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

Merged
merged 2 commits into from
Apr 30, 2025

Conversation

emilk
Copy link
Owner
@emilk emilk commented Apr 30, 2025

What

Fail all PRs that are opened from the master/main branch of the fork.

Why

PR:s opened from the master branch cannot be collaborated on. That is, we maintainers cannot push our own commits to it (e.g. to fix smaller problems with it before merging).

How

Untested code straight from Claude 3.7 😅

Copy link

Preview available at https://egui-pr-preview.github.io/pr/6899-emilkenforce-no-prs-from-master
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

@Mingun
Copy link
Contributor
Mingun commented Apr 30, 2025

Just want to comment, that it should be possible to push to master branch of other repository, see for example tafia/quick-xml#857, where I made a force-push to master branch of a contributor.

@emilk
Copy link
Owner Author
emilk commented Apr 30, 2025

I believe it is possible if the user has not protected their master branch (which they probably should). And force-pushing to someone else master doesn't seem like a good idea (having done so myself accidentally a few times).

Copy link
Collaborator
@lucasmerlin lucasmerlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I guess we have to merge this to see if this works

@emilk emilk merged commit f3611e3 into master Apr 30, 2025
46 checks passed
@emilk emilk deleted the emilk/enforce-no-prs-from-master branch April 30, 2025 12:11
@emilk
Copy link
Owner Author
emilk commented May 6, 2025

grtlr pushed a commit to rerun-io/rerun that referenced this pull request May 7, 2025
### Related
* Based on emilk/egui#6899
* Tested successfully in emilk/egui#7028

## What
Fail all PRs that are opened from the `main` branch of the fork.

## Why
PR:s opened from the `main` branch cannot be collaborated on. That is,
we maintainers cannot push our own commits to it (e.g. to fix smaller
problems with it before merging). This is because `main` is usually
protected (and even if it isn't, it probably _should_ be, and we should
not push commits directly into the `main` of some fork)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0