Skip to content

Conversation

Copy link

Copilot AI commented Jan 25, 2026

Documents recommended GitHub branch protection settings for the main branch.

Changes

  • docs/BRANCH-PROTECTION.md - Comprehensive guide covering:
    • Required PR reviews, status checks, conversation resolution
    • Linear history enforcement, force push/deletion restrictions
    • Configuration via GitHub UI, CLI, and Terraform
    • CODEOWNERS file example
    • Protected tags for releases
    • Branch naming conventions
    • Troubleshooting common issues

Example CLI Configuration

gh api repos/{owner}/{repo}/branches/main/protection \
  --method PUT \
  --field required_status_checks='{"strict":true,"contexts":["build","lint","test"]}' \
  --field required_pull_request_reviews='{"dismiss_stale_reviews":true,"required_approving_review_count":1}' \
  --field required_linear_history=true \
  --field allow_force_pushes=false

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: shyamsridhar123 <117464342+shyamsridhar123@users.noreply.github.com>
Copilot AI changed the title [WIP] Suggest branch protection rules for repository Add branch protection rules documentation Jan 25, 2026
Copilot AI requested a review from shyamsridhar123 January 25, 2026 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants