Skip to content

Class: GhaRepositoryRuleset

A ruleset: named rules that GitHub enforces on the branches, tags or pushes of a repository, or of every repository in an organization or enterprise that it targets.

URI: gha:RepositoryRuleset

 classDiagram
    class GhaRepositoryRuleset
    click GhaRepositoryRuleset href "../GhaRepositoryRuleset/"
      GhaRepositoryRuleset : bypass_actors
        
          
    
        
        
        GhaRepositoryRuleset --> "*" GhaBypassActor : bypass_actors
        click GhaBypassActor href "../GhaBypassActor/"
    

        
      GhaRepositoryRuleset : enforcement
        
          
    
        
        
        GhaRepositoryRuleset --> "1" GhaRulesetEnforcement : enforcement
        click GhaRulesetEnforcement href "../GhaRulesetEnforcement/"
    

        
      GhaRepositoryRuleset : ref_name_exclude
        
      GhaRepositoryRuleset : ref_name_include
        
      GhaRepositoryRuleset : requires_check
        
          
    
        
        
        GhaRepositoryRuleset --> "*" GhaRequiredStatusCheck : requires_check
        click GhaRequiredStatusCheck href "../GhaRequiredStatusCheck/"
    

        
      GhaRepositoryRuleset : rule_types
        
      GhaRepositoryRuleset : ruleset_id
        
      GhaRepositoryRuleset : ruleset_source
        
      GhaRepositoryRuleset : ruleset_source_type
        
          
    
        
        
        GhaRepositoryRuleset --> "0..1" GhaRulesetSourceType : ruleset_source_type
        click GhaRulesetSourceType href "../GhaRulesetSourceType/"
    

        
      GhaRepositoryRuleset : ruleset_target
        
          
    
        
        
        GhaRepositoryRuleset --> "1" GhaRulesetTarget : ruleset_target
        click GhaRulesetTarget href "../GhaRulesetTarget/"
    

        
      GhaRepositoryRuleset : ruleset_uri
        
      
Property Value
Class URI gha:RepositoryRuleset
Name Cardinality and Range Description Inheritance
ruleset_uri 1
Uri
The ruleset’s page, the REST response’s `_links direct
ruleset_id 0..1
Integer
The ruleset’s numeric id in the REST API direct
ruleset_source_type 0..1
GhaRulesetSourceType
What owns the ruleset, the REST field source_type: a repository, an organiz… direct
ruleset_source 0..1
String
The name of the repository, organization or enterprise that owns the ruleset,… direct
ruleset_target 1
GhaRulesetTarget
What the ruleset applies to, the REST field target direct
enforcement 1
GhaRulesetEnforcement
Whether GitHub enforces the ruleset, the REST field enforcement direct
ref_name_include *
String
The refs the ruleset applies to, from `conditions direct
ref_name_exclude *
String
The refs the ruleset leaves out, from `conditions direct
bypass_actors *
GhaBypassActor
The actors who may bypass the ruleset direct
rule_types *
String
The type of each rule the ruleset holds, such as deletion, `non_fast_forw… direct
requires_check *
GhaRequiredStatusCheck
The status checks the ruleset’s required_status_checks rule requires, each a … direct
used by used in type used
GhaDocument rulesets range GhaRepositoryRuleset
  • SLSA’s Source track calls such rules technical controls on protected named references, and asks that their meaning be documented and their enforcement recorded in attestations; the slsa schema models that evidence.
  • Of the rules’ parameters, only those of required_status_checks are modelled, as GhaRequiredStatusCheck; rule_types says which other rules the ruleset holds.
Mapping Type Mapped Value
self gha:RepositoryRuleset
native gha:GhaRepositoryRuleset
name: GhaRepositoryRuleset
description: 'A ruleset: named rules that GitHub enforces on the branches, tags or
pushes of a repository, or of every repository in an organization or enterprise
that it targets.'
comments:
- SLSA's Source track calls such rules technical controls on protected named references,
and asks that their meaning be documented and their enforcement recorded in attestations;
the slsa schema models that evidence.
- Of the rules' parameters, only those of required_status_checks are modelled, as
GhaRequiredStatusCheck; rule_types says which other rules the ruleset holds.
from_schema: https://w3id.org/lmodel/github-actions
see_also:
- https://docs.github.com/en/rest/repos/rules
- https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/available-rules-for-rulesets
attributes:
ruleset_uri:
name: ruleset_uri
description: The ruleset's page, the REST response's `_links.html.href`, such
as `https://github.com/<owner>/<repo>/rules/<id>`.
from_schema: https://w3id.org/lmodel/github-actions/github_actions_rules
rank: 1000
identifier: true
domain_of:
- GhaRepositoryRuleset
range: uri
ruleset_id:
name: ruleset_id
description: The ruleset's numeric `id` in the REST API.
from_schema: https://w3id.org/lmodel/github-actions/github_actions_rules
rank: 1000
domain_of:
- GhaRepositoryRuleset
range: integer
minimum_value: 1
ruleset_source_type:
name: ruleset_source_type
description: 'What owns the ruleset, the REST field `source_type`: a repository,
an organization or an enterprise.'
from_schema: https://w3id.org/lmodel/github-actions/github_actions_rules
rank: 1000
domain_of:
- GhaRepositoryRuleset
range: GhaRulesetSourceType
ruleset_source:
name: ruleset_source
description: The name of the repository, organization or enterprise that owns
the ruleset, the REST field `source`, such as `<owner>/<repo>`.
from_schema: https://w3id.org/lmodel/github-actions/github_actions_rules
rank: 1000
domain_of:
- GhaRepositoryRuleset
ruleset_target:
name: ruleset_target
description: What the ruleset applies to, the REST field `target`. Named ruleset_target
because LOKF defines a target slot of its own.
from_schema: https://w3id.org/lmodel/github-actions/github_actions_rules
rank: 1000
domain_of:
- GhaRepositoryRuleset
range: GhaRulesetTarget
required: true
enforcement:
name: enforcement
description: Whether GitHub enforces the ruleset, the REST field `enforcement`.
from_schema: https://w3id.org/lmodel/github-actions/github_actions_rules
rank: 1000
domain_of:
- GhaRepositoryRuleset
range: GhaRulesetEnforcement
required: true
ref_name_include:
name: ref_name_include
description: 'The refs the ruleset applies to, from `conditions.ref_name.include`:
names or patterns such as `refs/heads/main`, or `~DEFAULT_BRANCH` or `~ALL`.
A ref must match one of them.'
from_schema: https://w3id.org/lmodel/github-actions/github_actions_rules
rank: 1000
domain_of:
- GhaRepositoryRuleset
multivalued: true
ref_name_exclude:
name: ref_name_exclude
description: The refs the ruleset leaves out, from `conditions.ref_name.exclude`,
even when they match an included one.
from_schema: https://w3id.org/lmodel/github-actions/github_actions_rules
rank: 1000
domain_of:
- GhaRepositoryRuleset
multivalued: true
bypass_actors:
name: bypass_actors
description: The actors who may bypass the ruleset.
from_schema: https://w3id.org/lmodel/github-actions/github_actions_rules
rank: 1000
domain_of:
- GhaRepositoryRuleset
range: GhaBypassActor
multivalued: true
inlined: true
inlined_as_list: true
rule_types:
name: rule_types
description: The `type` of each rule the ruleset holds, such as `deletion`, `non_fast_forward`,
`pull_request` or `required_status_checks`.
comments:
- A pattern rather than an enumeration, because GitHub adds rule types.
from_schema: https://w3id.org/lmodel/github-actions/github_actions_rules
rank: 1000
domain_of:
- GhaRepositoryRuleset
multivalued: true
pattern: ^[a-z_]+$
requires_check:
name: requires_check
description: The status checks the ruleset's required_status_checks rule requires,
each a concept of its own.
from_schema: https://w3id.org/lmodel/github-actions/github_actions_rules
rank: 1000
domain_of:
- GhaRepositoryRuleset
range: GhaRequiredStatusCheck
multivalued: true
class_uri: gha:RepositoryRuleset
name: GhaRepositoryRuleset
description: 'A ruleset: named rules that GitHub enforces on the branches, tags or
pushes of a repository, or of every repository in an organization or enterprise
that it targets.'
comments:
- SLSA's Source track calls such rules technical controls on protected named references,
and asks that their meaning be documented and their enforcement recorded in attestations;
the slsa schema models that evidence.
- Of the rules' parameters, only those of required_status_checks are modelled, as
GhaRequiredStatusCheck; rule_types says which other rules the ruleset holds.
from_schema: https://w3id.org/lmodel/github-actions
see_also:
- https://docs.github.com/en/rest/repos/rules
- https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/available-rules-for-rulesets
attributes:
ruleset_uri:
name: ruleset_uri
description: The ruleset's page, the REST response's `_links.html.href`, such
as `https://github.com/<owner>/<repo>/rules/<id>`.
from_schema: https://w3id.org/lmodel/github-actions/github_actions_rules
rank: 1000
identifier: true
owner: GhaRepositoryRuleset
domain_of:
- GhaRepositoryRuleset
range: uri
required: true
ruleset_id:
name: ruleset_id
description: The ruleset's numeric `id` in the REST API.
from_schema: https://w3id.org/lmodel/github-actions/github_actions_rules
rank: 1000
owner: GhaRepositoryRuleset
domain_of:
- GhaRepositoryRuleset
range: integer
minimum_value: 1
ruleset_source_type:
name: ruleset_source_type
description: 'What owns the ruleset, the REST field `source_type`: a repository,
an organization or an enterprise.'
from_schema: https://w3id.org/lmodel/github-actions/github_actions_rules
rank: 1000
owner: GhaRepositoryRuleset
domain_of:
- GhaRepositoryRuleset
range: GhaRulesetSourceType
ruleset_source:
name: ruleset_source
description: The name of the repository, organization or enterprise that owns
the ruleset, the REST field `source`, such as `<owner>/<repo>`.
from_schema: https://w3id.org/lmodel/github-actions/github_actions_rules
rank: 1000
owner: GhaRepositoryRuleset
domain_of:
- GhaRepositoryRuleset
range: string
ruleset_target:
name: ruleset_target
description: What the ruleset applies to, the REST field `target`. Named ruleset_target
because LOKF defines a target slot of its own.
from_schema: https://w3id.org/lmodel/github-actions/github_actions_rules
rank: 1000
owner: GhaRepositoryRuleset
domain_of:
- GhaRepositoryRuleset
range: GhaRulesetTarget
required: true
enforcement:
name: enforcement
description: Whether GitHub enforces the ruleset, the REST field `enforcement`.
from_schema: https://w3id.org/lmodel/github-actions/github_actions_rules
rank: 1000
owner: GhaRepositoryRuleset
domain_of:
- GhaRepositoryRuleset
range: GhaRulesetEnforcement
required: true
ref_name_include:
name: ref_name_include
description: 'The refs the ruleset applies to, from `conditions.ref_name.include`:
names or patterns such as `refs/heads/main`, or `~DEFAULT_BRANCH` or `~ALL`.
A ref must match one of them.'
from_schema: https://w3id.org/lmodel/github-actions/github_actions_rules
rank: 1000
owner: GhaRepositoryRuleset
domain_of:
- GhaRepositoryRuleset
range: string
multivalued: true
ref_name_exclude:
name: ref_name_exclude
description: The refs the ruleset leaves out, from `conditions.ref_name.exclude`,
even when they match an included one.
from_schema: https://w3id.org/lmodel/github-actions/github_actions_rules
rank: 1000
owner: GhaRepositoryRuleset
domain_of:
- GhaRepositoryRuleset
range: string
multivalued: true
bypass_actors:
name: bypass_actors
description: The actors who may bypass the ruleset.
from_schema: https://w3id.org/lmodel/github-actions/github_actions_rules
rank: 1000
owner: GhaRepositoryRuleset
domain_of:
- GhaRepositoryRuleset
range: GhaBypassActor
multivalued: true
inlined: true
inlined_as_list: true
rule_types:
name: rule_types
description: The `type` of each rule the ruleset holds, such as `deletion`, `non_fast_forward`,
`pull_request` or `required_status_checks`.
comments:
- A pattern rather than an enumeration, because GitHub adds rule types.
from_schema: https://w3id.org/lmodel/github-actions/github_actions_rules
rank: 1000
owner: GhaRepositoryRuleset
domain_of:
- GhaRepositoryRuleset
range: string
multivalued: true
pattern: ^[a-z_]+$
requires_check:
name: requires_check
description: The status checks the ruleset's required_status_checks rule requires,
each a concept of its own.
from_schema: https://w3id.org/lmodel/github-actions/github_actions_rules
rank: 1000
owner: GhaRepositoryRuleset
domain_of:
- GhaRepositoryRuleset
range: GhaRequiredStatusCheck
multivalued: true
class_uri: gha:RepositoryRuleset