Home > Blockchain >  Is it possible to have different access privileges on different folders in a GitHub Repository?
Is it possible to have different access privileges on different folders in a GitHub Repository?

Time:02-12

I have a GitHub repository with two folders, A and B. The first Folder A needs to require a Pull Requests to commit a change to the code so that I can implement a peer review process. Folder B I would like to be open, where users can commit changes freely, without requiring a Pull Request. Is this something that is possible? Any suggestions of how I could implement this?

CodePudding user response:

No this isn't possible. A pull-request policy is set at the branch level and there is no exclusion option for specific folders. You can use the CODE OWNERS feature to assign required reviewers to the parts that require review and then let people complete their own pull requests if no required reviewers are assigned.

See:

An other option would be to have people commit changes to FolderB on a separate branch without protection and let GitHub actions merge the changes into target branch while bypassing protections. You'll need to use a Personal Access Token of a repository administrator to bypass the protections.

  • Related