sinpro.dev
Docs
Company Information
Portfolio
  • Company Information
    • Portfolio
    • About
    • Services
    • Events
  • Dev Environment
    • macOS Settings
    • Chrome Extensions
    • VSCode Workspace Settings
    • VSCode Workspace Extensions
    • Global NPM Packages
    • npm-check-updates
    • SvelteKit
    • Customize Zsh
    • ChatGPT Prompts
    • Tailwind CSS
    • Warp
    • Keyboard Shortcuts
  • Assets
    • Assets
    • JPG/PNG to AVIF
    • TTF to WOFF2
  • Clean Code
    • Clean Code
    • Format
    • Quality
    • Variables
    • Functions
    • Objects and Data Structures
    • Classes
    • Concurrency
    • Error handling
    • Comments
  • Code Style
    • TypeScript Config
    • Prettier
    • ESLint
    • Stylelint
  • Testing
    • Vitest
    • Playwright
  • Git
    • Git Branches and Commits
    • Git Hooks
    • Git User Profiles
    • Git for Windows
  • GitHub
    • GitHub Issues
    • GitHub Pull Requests
    • GitHub Repository Settings
    • GitHub Branch Protection
    • GitHub Actions
  • Code Quality
    • SonarCloud Coverage
  • Server
    • SSH
    • PM2
    • Caddy
    • Updating the server
    • ngrok
  • Team sinProject
    • Our Team Policy
    • Equipment and Supplies
    • Books
    • Slack
    • Locales
    • Funny Apps
    • Docs History
  • Talk
    • Talk
    • Creating a Project
    • App Structure

GitHub

GitHub Branch Protection

Edit this page

Managing a branch protection rule

You can create a branch protection rule to enforce certain workflows for one or more branches, such as requiring an approving review or passing status checks for all pull requests merged into the protected branch.

More Information >

How to create a branch protection rule

  • Open Target Repository > Settings > Branches
  • Push Add rule button

Settings

Branch name pattern

main

Protect matching branches

Apply the following settings:

  • Require a pull request before merging
    • Require approvals: 1
    • Dismiss stale pull request approvals when new commits are pushed
  • Require status checks to pass before merging
    • Status checks that are required.: Search for the target Actions and add them.
  • Restrict who can push to matching branches
    • Restrict pushes that create matching branches
GitHub Repository Settings GitHub Actions
© sinProject. v0.73.0
On this page
  • GitHub Branch Protection
  • Managing a branch protection rule
  • How to create a branch protection rule
  • Settings
  • Branch name pattern
  • Protect matching branches