Skip to content

πŸš€ The fast, Pythonic way to build MCP servers and clients.

Add no-commit-to-branch hook to prevent direct commits to main (#1149)

nate nowack64d469be98cd
diff --git a/.github/workflows/run-static.yml b/.github/workflows/run-static.yml
index bb4ade8f4..4ef8d2430 100644
--- a/.github/workflows/run-static.yml
+++ b/.github/workflows/run-static.yml
@@ -44,3 +44,5 @@ jobs:
run: uv sync --dev
- name: Run pre-commit
uses: pre-commit/[email protected]
+ env:
+ SKIP: no-commit-to-branch
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 9b1efe160..bca0329bc 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -27,3 +27,9 @@ repos:
hooks:
- id: pyright-pretty
files: ^src/|^tests/
+
+ - repo: https://github.com/pre-commit/pre-commit-hooks
+ rev: v4.3.0
+ hooks:
+ - id: no-commit-to-branch
+ args: [--branch, main]