Text of docs.github.com › de › rest › orgs › rules as Styx crawled it on Oct 10, 2026. The page may have changed since. Only its words are kept, without pictures or layout, and only the first part of a long page.

Open the live page

REST-API-Endpunkte für Regeln - GitHub Dokumente

Skip to main content Skip to content Randleiste reduzieren Randleiste erweitern Die REST-API ist jetzt versioniert. Weitere Informationen findest du unter Informationen zur API-Versionsverwaltung . REST-API-Endpunkte für Regeln Verwenden Sie die REST-API, um Regelsätze für Organisationen zu verwalten. Organisationsregelsätze steuern, wie Benutzer*innen mit ausgewählten Branches und Tags in den Repositorys einer Organisation interagieren können.

Get all organization repository rulesets Get all the repository rulesets for an organization. Feinkörnige Zugriffstoken für "Get all organization repository rulesets" Dieser Endpunkt funktioniert mit den folgenden differenzierten Tokentypen. : GitHub App-Benutzerzugriffstoken GitHub-App-Installations-Zugriffstoken Feingranulare persönliche Zugriffstoken Das differenzierte Token muss über den folgenden Berechtigungssatz verfügen.: "Administration" organization permissions (write) Parameter für "Get all organization repository rulesets" Header Name, Typ, BESCHREIBUNG accept string Setting to application/vnd.github+json is recommended.

Pfadparameter Name, Typ, BESCHREIBUNG org string Erforderlich The organization name. The name is not case sensitive. Abfrageparameter Name, Typ, BESCHREIBUNG per_page integer The number of results per page (max 100). For more information, see " Using pagination in the REST API ." Standard : 30 page integer The page number of the results to fetch. For more information, see " Using pagination in the REST API ." Standard : 1 targets string A comma-separated list of rule targets to filter by.

If provided, only rulesets that apply to the specified targets will be returned. For example, branch,tag,push . HTTP-Antwortstatuscodes für "Get all organization repository rulesets" Statuscode BESCHREIBUNG 200 OK 404 Resource not found 500 Internal Error Codebeispiele für "Get all organization repository rulesets" Anforderungsbeispiel get /orgs/{org}/rulesets In Zwischenablage kopieren curl request example curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2026-03-10" \ https://api.github.com/orgs/ORG/rulesets Response Status: 200 [ { "id": 21, "name": "super cool ruleset", "source_type": "Organization", "source": "my-org", "enforcement": "enabled", "node_id": "RRS_lACkVXNlcgQB", "_links": { "self": { "href": "https://api.github.com/orgs/my-org/rulesets/21" }, "html": { "href": "https://github.com/organizations/my-org/settings/rules/21" } }, "created_at": "2023-07-15T08:43:03Z", "updated_at": "2023-08-23T16:29:47Z" }, { "id": 432, "name": "Another ruleset", "source_type": "Organization", "source": "my-org", "enforcement": "enabled", "node_id": "RRS_lACkVXNlcgQQ", "_links": { "self": { "href": "https://api.github.com/orgs/my-org/rulesets/432" }, "html": { "href": "https://github.com/organizations/my-org/settings/rules/432" } }, "created_at": "2023-08-15T08:43:03Z", "updated_at": "2023-09-23T16:29:47Z" } ] Create an organization repository ruleset Create a repository ruleset for an organization.

Feinkörnige Zugriffstoken für "Create an organization repository ruleset" Dieser Endpunkt funktioniert mit den folgenden differenzierten Tokentypen. : GitHub App-Benutzerzugriffstoken GitHub-App-Installations-Zugriffstoken Feingranulare persönliche Zugriffstoken Das differenzierte Token muss über den folgenden Berechtigungssatz verfügen.: "Administration" organization permissions (write) Parameter für "Create an organization repository ruleset" Header Name, Typ, BESCHREIBUNG accept string Setting to application/vnd.github+json is recommended.

Pfadparameter Name, Typ, BESCHREIBUNG org string Erforderlich The organization name. The name is not case sensitive. Körperparameter Name, Typ, BESCHREIBUNG name string Erforderlich The name of the ruleset. target string The target of the ruleset Standard : branch Kann eine der folgenden sein : branch , tag , push , repository enforcement string Erforderlich 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). Kann eine der folgenden sein : disabled , active , evaluate bypass_actors array of objects The actors that can bypass the rules in this ruleset Properties of bypass_actors Name, Typ, BESCHREIBUNG actor_id integer or null The ID of the actor that can bypass a ruleset. Required for Integration , RepositoryRole , Team , and User actor types.

If actor_type is OrganizationAdmin , actor_id is ignored. If actor_type is DeployKey , this should be null. OrganizationAdmin is not applicable for personal repositories. actor_type string Erforderlich The type of actor that can bypass a ruleset. Kann eine der folgenden sein : Integration , OrganizationAdmin , RepositoryRole , Team , DeployKey , User bypass_mode string When the specified actor can bypass the ruleset. pull_request means that an actor can only bypass rules on pull requests. pull_request is not applicable for the DeployKey actor type.

Also, pull_request is only applicable to branch rulesets. When bypass_mode is exempt , rules will not be run for that actor and a bypass audit entry will not be created. Standard : always Kann eine der folgenden sein : always , pull_request , exempt conditions object Conditions for an organization ruleset. The branch and tag rulesets conditions object should contain both repository_name and ref_name properties, or both repository_id and ref_name properties, or both repository_property and ref_name properties.

The push rulesets conditions object does not require the ref_name property. For repository policy rulesets, the conditions object should only contain the repository_name , the repository_id , or the repository_property . Can be one of these objects: Name, Typ, BESCHREIBUNG repository_name_and_ref_name object Conditions to target repositories by name and refs by name Properties of repository_name_and_ref_name Name, Typ, BESCHREIBUNG ref_name object Properties of ref_name Name, Typ, BESCHREIBUNG include array of strings 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. exclude array of strings Array of ref names or patterns to exclude. The condition will not pass if any of these patterns match. repository_name object Erforderlich Properties of repository_name Name, Typ, BESCHREIBUNG include array of strings 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. exclude array of strings Array of repository names or patterns to exclude. The condition will not pass if any of these patterns match. protected boolean Whether renaming of target repositories is prevented. repository_id_and_ref_name object Conditions to target repositories by id and refs by name Properties of repository_id_and_ref_name Name, Typ, BESCHREIBUNG ref_name object Properties of ref_name Name, Typ, BESCHREIBUNG include array of strings 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. exclude array of strings Array of ref names or patterns to exclude. The condition will not pass if any of these patterns match. repository_id object Erforderlich Properties of repository_id Name, Typ, BESCHREIBUNG repository_ids array of integers The repository IDs that the ruleset applies to.

One of these IDs must match for the condition to pass. repository_property_and_ref_name object Conditions to target repositories by property and refs by name Properties of repository_property_and_ref_name Name, Typ, BESCHREIBUNG ref_name object Properties of ref_name Name, Typ, BESCHREIBUNG include array of strings Array

The rest of this page is on the live site.