> For the complete documentation index, see [llms.txt](https://docs.tuannvm.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tuannvm.com/mcp-trino/docs/branch-protection.md). Agents can also search and read this documentation through its [MCP server](https://docs.tuannvm.com/~gitbook/mcp).

# Branch Protection Rules

This project uses GitHub Branch Protection Rules to ensure code quality and prevent breaking changes from being merged to the main branch.

## Setting up Branch Protection

1. Navigate to your GitHub repository
2. Go to `Settings` > `Branches`
3. Under `Branch protection rules`, click `Add rule`
4. Configure the following settings:

### Basic Settings

* Branch name pattern: `main`
* Check "Require a pull request before merging"
* Check "Require approvals" and set it to at least 1

### Status Checks

* Check "Require status checks to pass before merging"
* Check "Require branches to be up to date before merging"
* In the status checks search box, select all the CI checks:
  * `Static Analysis`
  * `Build`
  * `Test`

### Additional Settings (Recommended)

* Check "Include administrators" to ensure everyone follows the same rules
* Check "Restrict who can push to matching branches" and add appropriate teams/users
* Check "Allow force pushes" and select "Specify who can force push" for administrators only

## Effect of these Rules

With these rules in place:

1. Direct pushes to the `main` branch are prevented
2. All changes must go through pull requests
3. Pull requests require at least one approval
4. All CI checks must pass before merging
5. Branches must be up-to-date with the base branch before merging

This ensures that:

* Code is reviewed
* Tests pass
* Static analysis is successful
* The codebase maintains high quality standards


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.tuannvm.com/mcp-trino/docs/branch-protection.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
