Back to GithubUpdate a repository ruleset
Update a ruleset for a repository.
Input
type: object
properties:
parameters:
type: object
properties:
owner:
type: string
description: The account owner of the repository. The name is not case sensitive.
repo:
type: string
description: The name of the repository. The name is not case sensitive.
ruleset_id:
type: integer
description: The ID of the ruleset.
required:
- owner
- repo
- ruleset_id
title: Parameters
data:
type: object
properties:
name:
type: string
description: The name of the ruleset.
target:
type: string
description: The target of the ruleset.
enum:
- branch
- tag
enforcement:
type: string
description: >-
The enforcement level of the ruleset. `evaluate` allows admins to test
rules before enforcing them. Admins can view insights on the Rule
Insights page (`evaluate` is only available with GitHub Enterprise).
enum:
- disabled
- active
- evaluate
bypass_mode:
type: string
description: >-
The permission level required to bypass this ruleset. "repository"
allows those with bypass permission at the repository level to bypass.
"organization" allows those with bypass permission at the organization
level to bypass. "none" prevents anyone from bypassing.
enum:
- none
- repository
- organization
bypass_actors:
type: array
description: The actors that can bypass the rules in this ruleset
items:
type: object
title: Repository Ruleset Bypass Actor
properties:
actor_id:
type: integer
description: The ID of the actor that can bypass a ruleset
actor_type:
type: string
enum:
- Team
- Integration
description: The type of actor that can bypass a ruleset
conditions:
type: object
title: Repository ruleset conditions for ref names
properties:
ref_name:
type: object
properties:
include:
type: array
description: >-
Array of ref names or patterns to include. One of these
patterns must match for the condition to pass. Also accepts
`~DEFAULT_BRANCH` to include the default branch or `~ALL` to
include all branches.
items:
type: string
exclude:
type: array
description: >-
Array of ref names or patterns to exclude. The condition will
not pass if any of these patterns match.
items:
type: string
rules:
description: An array of rules within the ruleset.
type: array
items:
type: object
title: Repository Rule
title: Data
Output
type: object
title: Repository ruleset
properties:
id:
type: integer
description: The ID of the ruleset
name:
type: string
description: The name of the ruleset
target:
type: string
description: The target of the ruleset
enum:
- branch
- tag
source_type:
type: string
description: The type of the source of the ruleset
enum:
- Repository
- Organization
source:
type: string
description: The name of the source
enforcement:
type: string
description: >-
The enforcement level of the ruleset. `evaluate` allows admins to test
rules before enforcing them. Admins can view insights on the Rule Insights
page (`evaluate` is only available with GitHub Enterprise).
enum:
- disabled
- active
- evaluate
bypass_mode:
type: string
description: >-
The permission level required to bypass this ruleset. "repository" allows
those with bypass permission at the repository level to bypass.
"organization" allows those with bypass permission at the organization
level to bypass. "none" prevents anyone from bypassing.
enum:
- none
- repository
- organization
bypass_actors:
type: array
description: The actors that can bypass the rules in this ruleset
items:
type: object
title: Repository Ruleset Bypass Actor
properties:
actor_id:
type: integer
description: The ID of the actor that can bypass a ruleset
actor_type:
type: string
enum:
- Team
- Integration
description: The type of actor that can bypass a ruleset
node_id:
type: string
_links:
type: object
properties:
self:
type: object
properties:
href:
type: string
description: The URL of the ruleset
conditions:
type: object
title: Repository ruleset conditions for ref names
properties:
ref_name:
type: object
properties:
include:
type: array
items:
type: string
exclude:
type: array
items:
type: string
repository_name:
type: object
properties:
include:
type: array
description: >-
Array of repository names or patterns to include. One of these
patterns must match for the condition to pass. Also accepts `~ALL`
to include all repositories.
items:
type: string
exclude:
type: array
description: >-
Array of repository names or patterns to exclude. The condition
will not pass if any of these patterns match.
items:
type: string
protected:
type: boolean
description: Whether renaming of target repositories is prevented.
rules:
type: array
items:
type: object
title: Repository Rule