rules
Overview
Name | rules |
Type | Resource |
Id | github.repos.rules |
Fields
Name | Datatype | Description |
---|---|---|
id | integer | The ID of the ruleset |
name | string | The name of the ruleset |
_links | object | |
bypass_actors | array | The actors that can bypass the rules in this ruleset |
conditions | object | Parameters for a repository ruleset ref name condition |
created_at | string | |
current_user_can_bypass | string | The bypass type of the user making the API request for this ruleset. This field is only returned when querying the repository-level endpoint. |
enforcement | string | 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). |
node_id | string | |
rules | array | |
source | string | The name of the source |
source_type | string | The type of the source of the ruleset |
target | string | The target of the ruleset |
updated_at | string |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get_repo_ruleset | SELECT | owner, repo, ruleset_id | Get a ruleset for a repository. |
get_repo_rulesets | SELECT | owner, repo | Get all the rulesets for a repository. |
create_repo_ruleset | INSERT | owner, repo, data__enforcement, data__name | Create a ruleset for a repository. |
delete_repo_ruleset | DELETE | owner, repo, ruleset_id | Delete a ruleset for a repository. |
get_branch_rules | EXEC | branch, owner, repo | Returns all active rules that apply to the specified branch. The branch does not need to exist; rules that would apply to a branch with that name will be returned. All active rules that apply will be returned, regardless of the level at which they are configured (e.g. repository or organization). Rules in rulesets with "evaluate" or "disabled" enforcement statuses are not returned. |
update_repo_ruleset | EXEC | owner, repo, ruleset_id | Update a ruleset for a repository. |