GET
github_repos_get_branch_protection.py
Requires
repo, read:user.Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Read a branch’s protection rules — required checks, required reviews, linear history — before attempting a write that they would refuse. A 404 means either no such branch or no protection on it; GitHub does not distinguish them.
from charter.packs import github
result = await github.repos_get_branch_protection.ainvoke({"owner": ..., "repo": ..., "branch": ...})
repo, read:user.| Field | Type | Description |
|---|---|---|
owner * | string | The account owner of the repository. The name is not case sensitive. |
repo * | string | The name of the repository without the .git extension. The name is not case sensitive. |
branch * | string | The name of the branch. Cannot contain wildcard characters. A plain name — main, not refs/heads/main. |
Was this page helpful?