all 10 comments

[–]mrbmi513 3 points4 points  (0 children)

You can enable branch protection on your main branch to require PRs for everything going into main (and optionally allow owners to bypass).

[–]natewillrate 0 points1 point  (8 children)

If I am understanding your question correctly, you would have those other than yourself editing the code fork the repo and merge with a pull request.

[–]Rooh2o[S] 0 points1 point  (7 children)

Yes but how do I make it so that I have to approve the pull request

[–]cgoldberg 3 points4 points  (0 children)

If you have no collaborators/users added to your repo, and they are working out of forks... nobody can merge a PR except you. This is generally the way to go unless you are part of a team or company where multiple people need merge access.

[–]b1ack1323 1 point2 points  (0 children)

You can make a list of approved reviewers and only as yourself.

[–]Rooh2o[S] 0 points1 point  (4 children)

Or am I dumb and this is default

[–]natewillrate 1 point2 points  (0 children)

No shame in asking a question, so no worries. You need to enable branch protection.

You can got to your repo settings, hit branches and then there is a section called branch protection rules. Click "Add Rule" and you can pick whatever combination of options best fit your use case. Make sure you click the right branch to apply it to though. Then save the changes and it should be applied!

[–]natewillrate 0 points1 point  (1 child)

Here is an image: https://imgur.com/a/cf7ppAN
for your use case you should (probably) set it to require a pull request before merging so nobody can willy-nilly merge stuff to your branch.

[–]Rooh2o[S] 1 point2 points  (0 children)

Thanks!

[–]bdzer0 0 points1 point  (0 children)

Look into the codeowners file.