Branch¶
-
class
github.Branch.
Branch
¶ This class represents Branches. The reference can be found here https://docs.github.com/en/rest/reference/repos#branches
-
commit
¶ Type: github.Commit.Commit
-
name
¶ Type: string
-
protected
¶ Type: bool
-
protection_url
¶ Type: string
-
get_protection
()¶ Calls: GET /repos/{owner}/{repo}/branches/{branch}/protection
-
edit_protection
(strict=NotSet, contexts=NotSet, enforce_admins=NotSet, dismissal_users=NotSet, dismissal_teams=NotSet, dismissal_apps=NotSet, dismiss_stale_reviews=NotSet, require_code_owner_reviews=NotSet, required_approving_review_count=NotSet, user_push_restrictions=NotSet, team_push_restrictions=NotSet, app_push_restrictions=NotSet, required_linear_history=NotSet, allow_force_pushes=NotSet, required_conversation_resolution=NotSet, lock_branch=NotSet, allow_fork_syncing=NotSet, users_bypass_pull_request_allowances=NotSet, teams_bypass_pull_request_allowances=NotSet, apps_bypass_pull_request_allowances=NotSet, block_creations=NotSet)¶ Calls: PUT /repos/{owner}/{repo}/branches/{branch}/protection Strict: bool Contexts: list of strings Enforce_admins: bool Dismissal_users: list of strings Dismissal_teams: list of strings Dismissal_apps: list of strings Dismiss_stale_reviews: bool Require_code_owner_reviews: bool Required_approving_review_count: int User_push_restrictions: list of strings Team_push_restrictions: list of strings App_push_restrictions: list of strings Required_linear_history: bool Allow_force_pushes: bool Required_conversation_resolution: bool Lock_branch: bool Allow_fork_syncing: bool Users_bypass_pull_request_allowances: list of strings Teams_bypass_pull_request_allowances: list of strings Apps_bypass_pull_request_allowances: list of strings Block_creations: bool NOTE: The GitHub API groups strict and contexts together, both must be submitted. Take care to pass both as arguments even if only one is changing. Use edit_required_status_checks() to avoid this.
-
remove_protection
()¶ Calls: DELETE /repos/{owner}/{repo}/branches/{branch}/protection
-
get_required_status_checks
()¶ Calls: GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks Return type: github.RequiredStatusChecks.RequiredStatusChecks
-
edit_required_status_checks
(strict=NotSet, contexts=NotSet)¶ Calls: PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks Strict: bool Contexts: list of strings
-
remove_required_status_checks
()¶ Calls: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks
-
get_required_pull_request_reviews
()¶ Calls: GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews Return type: github.RequiredPullRequestReviews.RequiredPullRequestReviews
-
edit_required_pull_request_reviews
(dismissal_users=NotSet, dismissal_teams=NotSet, dismissal_apps=NotSet, dismiss_stale_reviews=NotSet, require_code_owner_reviews=NotSet, required_approving_review_count=NotSet)¶ Calls: PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews Dismissal_users: list of strings Dismissal_teams: list of strings Dismissal_apps: list of strings Dismiss_stale_reviews: bool Require_code_owner_reviews: bool Required_approving_review_count: int
-
remove_required_pull_request_reviews
()¶ Calls: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews
-
get_admin_enforcement
()¶ Calls: GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins Return type: bool
-
set_admin_enforcement
()¶ Calls: POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins
-
remove_admin_enforcement
()¶ Calls: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins
-
get_user_push_restrictions
()¶ Calls: GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users Return type: github.PaginatedList.PaginatedList
ofgithub.NamedUser.NamedUser
-
get_team_push_restrictions
()¶ Calls: GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams Return type: github.PaginatedList.PaginatedList
ofgithub.Team.Team
-
add_user_push_restrictions
(*users)¶ Calls: POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users Users: list of strings (user names)
-
replace_user_push_restrictions
(*users)¶ Calls: PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users Users: list of strings (user names)
-
remove_user_push_restrictions
(*users)¶ Calls: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users Users: list of strings (user names)
-
add_team_push_restrictions
(*teams)¶ Calls: POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams Teams: list of strings (team slugs)
-
replace_team_push_restrictions
(*teams)¶ Calls: PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams Teams: list of strings (team slugs)
-
remove_team_push_restrictions
(*teams)¶ Calls: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams Teams: list of strings (team slugs)
-
remove_push_restrictions
()¶ Calls: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions
-
get_required_signatures
()¶ Calls: GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures
-
add_required_signatures
()¶ Calls: POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures
-
remove_required_signatures
()¶ Calls: DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures
-