Skip to content

Best practice for protection of the gh-pages branch? #1000

Answered by peaceiris
James-Oswald asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, the branch protection rules are helpful for that use case.

Restrict who can push to matching branches: Specify people, teams, or apps allowed to push to matching branches. Required status checks will still prevent these people, teams, and apps from merging if the checks fail.

https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches#restrict-who-can-push-to-matching-branches

The first choice is creating a personal access token for the github_token input and adding a user who owns the PAT to that setting. The best is creating a GitHub App, adding the app to that setting, and generating a token with

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by James-Oswald
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants