Configure required status checks
Configure GitHub branch protection rules for required CI checks, approving reviews, stale-review dismissal, and linear history via API or Terraform.
Preview
Copy prompt
Configure branch protection rules for the main branch of [Repository] to enforce code quality gates before merging. Require that all of the following CI status checks pass before a merge is allowed: [List the specific check names]. Require at least [N] approving reviews from code owners. Configure automatic dismissal of existing approvals when new commits are pushed to an open pull request. Block force pushes to the main branch. Require a linear commit history. Show both the GitHub web UI steps and the equivalent GitHub API or Terraform configuration for automating this setup.
More
Git & Version Control
Prompts
