Using the "codeowners" feature
This is free for public repositories and paid for private repositories.
Step 1: Define code owners
Code owners are defined by adding a file named CODEOWNERS to the root of your repository.
Syntax:
# <directory or file filter> <user or group>
# Examples:
README.md @octocat
/veryimportant/ @myorganization/teamname
Documentation: https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners
Step 2: Restrict Pull Requests
With paid github subscriptions, PRs can be restricted in a way that a review by a code owner is required before merging it:

Result
Having this configured, pull requests with changes to the locations / files / directories configured via the CODEOWNERS
file require a code owner review. Screenshot:

Step 3: Restrict Admins
Admins and owners would still be able to commit directly to master
. It is therefore recommended to apply the branch restrictions to Admins as well:
