Branches - GitHub Docs
Skip to main content Skip to content Collapse sidebar Expand sidebar Branches Reference documentation for GraphQL schema types in the Branches category. In this article Mutations createBranchProtectionRule Mutation Create a new branch protection rule. Input fields for createBranchProtectionRule input ( CreateBranchProtectionRuleInput! ) Return fields for createBranchProtectionRule Name Description branchProtectionRule ( BranchProtectionRule ) The newly created BranchProtectionRule. clientMutationId ( String ) A unique identifier for the client performing the mutation. deleteBranchProtectionRule Mutation Delete a branch protection rule.
Input fields for deleteBranchProtectionRule input ( DeleteBranchProtectionRuleInput! ) Return fields for deleteBranchProtectionRule Name Description clientMutationId ( String ) A unique identifier for the client performing the mutation. mergeBranch Mutation Merge a head into a branch. Input fields for mergeBranch input ( MergeBranchInput! ) Return fields for mergeBranch Name Description clientMutationId ( String ) A unique identifier for the client performing the mutation. mergeCommit ( Commit ) The resulting merge Commit. updateBranchProtectionRule Mutation Update a branch protection rule.
Input fields for updateBranchProtectionRule input ( UpdateBranchProtectionRuleInput! ) Return fields for updateBranchProtectionRule Name Description branchProtectionRule ( BranchProtectionRule ) The newly created BranchProtectionRule. clientMutationId ( String ) A unique identifier for the client performing the mutation. Objects BranchNamePatternParameters Object Parameters to be used for the branch_name_pattern rule.
Fields for BranchNamePatternParameters Name Description name ( String ) How this rule appears when configuring it. negate ( Boolean! ) If true, the rule will fail if the pattern matches. operator ( String! ) The operator to use for matching. pattern ( String! ) The pattern to match with. BranchProtectionRule Object A branch protection rule. BranchProtectionRule Implements Node Fields for BranchProtectionRule Name Description allowsDeletions ( Boolean! ) Can this branch be deleted. allowsForcePushes ( Boolean! ) Are force pushes allowed on this branch. blocksCreations ( Boolean! ) Is branch creation a protected operation. branchProtectionRuleConflicts ( BranchProtectionRuleConflictConnection! ) A list of conflicts matching branches protection rule and other branch protection rules.
Arguments for branchProtectionRuleConflicts after ( String ) Returns the elements in the list that come after the specified cursor. before ( String ) Returns the elements in the list that come before the specified cursor. first ( Int ) Returns the first n elements from the list. last ( Int ) Returns the last n elements from the list. bypassForcePushAllowances ( BypassForcePushAllowanceConnection! ) A list of actors able to force push for this branch protection rule.
Arguments for bypassForcePushAllowances after ( String ) Returns the elements in the list that come after the specified cursor. before ( String ) Returns the elements in the list that come before the specified cursor. first ( Int ) Returns the first n elements from the list. last ( Int ) Returns the last n elements from the list. bypassPullRequestAllowances ( BypassPullRequestAllowanceConnection! ) A list of actors able to bypass PRs for this branch protection rule.
Arguments for bypassPullRequestAllowances after ( String ) Returns the elements in the list that come after the specified cursor. before ( String ) Returns the elements in the list that come before the specified cursor. first ( Int ) Returns the first n elements from the list. last ( Int ) Returns the last n elements from the list. creator ( Actor ) The actor who created this branch protection rule. databaseId ( Int ) Identifies the primary key from the database. dismissesStaleReviews ( Boolean! ) Will new commits pushed to matching branches dismiss pull request review approvals. id ( ID! ) The Node ID of the BranchProtectionRule object. isAdminEnforced ( Boolean! ) Can admins override branch protection. lockAllowsFetchAndMerge ( Boolean! ) Whether users can pull changes from upstream when the branch is locked.
Set to true to allow fork syncing. Set to false to prevent fork syncing. lockBranch ( Boolean! ) Whether to set the branch as read-only. If this is true, users will not be able to push to the branch. matchingRefs ( RefConnection! ) Repository refs that are protected by this rule. Arguments for matchingRefs after ( String ) Returns the elements in the list that come after the specified cursor. before ( String ) Returns the elements in the list that come before the specified cursor. first ( Int ) Returns the first n elements from the list. last ( Int ) Returns the last n elements from the list. query ( String ) Filters refs with query on name. pattern ( String! ) Identifies the protection rule pattern. pushAllowances ( PushAllowanceConnection! ) A list push allowances for this branch protection rule.
Arguments for pushAllowances after ( String ) Returns the elements in the list that come after the specified cursor. before ( String ) Returns the elements in the list that come before the specified cursor. first ( Int ) Returns the first n elements from the list. last ( Int ) Returns the last n elements from the list. repository ( Repository ) The repository associated with this branch protection rule. requireLastPushApproval ( Boolean! ) Whether the most recent push must be approved by someone other than the person who pushed it. requiredApprovingReviewCount ( Int ) Number of approving reviews required to update matching branches. requiredDeploymentEnvironments ( [String] ) List of required deployment environments that must be deployed successfully to update matching branches. requiredStatusCheckContexts ( [String] ) List of required status check contexts that must pass for commits to be accepted to matching branches. requiredStatusChecks ( [RequiredStatusCheckDescription!] ) List of required status checks that must pass for commits to be accepted to matching branches. requiresApprovingReviews ( Boolean! ) Are approving reviews required to update matching branches. requiresCodeOwnerReviews ( Boolean! ) Are reviews from code owners required to update matching branches. requiresCommitSignatures ( Boolean! ) Are commits required to be signed. requiresConversationResolution ( Boolean! ) Are conversations required to be resolved before merging. requiresDeployments ( Boolean! ) Does this branch require deployment to specific environments before merging. requiresLinearHistory ( Boolean! ) Are merge commits prohibited from being pushed to this branch. requiresStatusChecks ( Boolean! ) Are status checks required to update matching branches. requiresStrictStatusChecks ( Boolean! ) Are branches required to be up to date before merging. restrictsPushes ( Boolean! ) Is pushing to matching branches restricted. restrictsReviewDismissals ( Boolean! ) Is dismissal of pull request reviews restricted. reviewDismissalAllowances ( ReviewDismissalAllowanceConnection! ) A list review dismissal allowances for this branch protection rule.
Arguments for reviewDismissalAllowances after ( String ) Returns the elements in the list that come after the specified cursor. before ( String ) Returns the elements in the list that come before the specified cursor. first ( Int ) Returns the first n elements from the list. last ( Int ) Returns the last n elements from the list. BranchProtectionRuleConflict Object A conflict between two branch protection rules. Fields for BranchProtectionRuleConflict Name Description branchProtectionRule ( BranchProtectionRule ) Identifies the branch protection rule. conflictingBranchProtectionRule ( BranchProtectionRule ) Identifies the conflicting branch protection rule. ref ( Ref ) Identifies the branch ref that has conflicting rules.
BranchProtectionRuleConflictConnection Object The connection type for BranchProtect
The rest of this page is on the live site.