title | intro | product | versions | permissions | topics | shortTitle | |||
---|---|---|---|---|---|---|---|---|---|
Managing rulesets for a repository |
You can edit, monitor, and delete existing rulesets in a repository to alter how people can interact with specific branches and tags. |
{% data reusables.gated-features.repo-rules %} |
|
{% data reusables.repositories.repo-rules-permissions %} |
|
Manage a ruleset |
After creating a ruleset, you can still make changes to it. For example, you can add rules to better protect your branches or tags, or you can {% ifversion repo-rules-enterprise %}switch your ruleset from "Evaluate" mode to "Active" after testing its effects on the contributor experience for your repository{% else %}temporarily disable a ruleset to troubleshoot any unintended effects on the contributor experience for your repository{% endif %}.
You can use the REST and GraphQL APIs to manage rulesets. For more information, see "AUTOTITLE" and "AUTOTITLE."
{% ifversion repo-rules-enterprise %} {% tip %}
Tip: If you're the owner of an organization, you can create rulesets at the organization level. You can apply these rulesets to specific repositories in your organization, and to specific branches in those repositories. For more information, see "AUTOTITLE."
{% endtip %} {% endif %}
On the "Rulesets" page, anyone with read access to the repository can view the active rulesets targeting a certain {% ifversion push-rulesets %}branch, tag, or push restriction.{% else %}branch or tag.{% endif %} {% ifversion repo-rules-enterprise %}You will also see rulesets running in "Evaluate" mode, which are not enforced.{% endif %}
{% ifversion push-rulesets %}
For push rulesets for forked repositories, the "Rulesets" page will indicate that the ruleset is managed by the source repository where the rule is applied.
{% endif %}
{% data reusables.repositories.navigate-to-repo %} {% data reusables.repositories.navigate-to-branches %}
- To the left of the branch name, click {% octicon "shield-lock" aria-label="view rules" %}.
- Optionally, to filter the results click the tabs or use the "Search branches" search bar.
- Click the name of the ruleset you want to view.
{% ifversion repo-rules-enterprise %} {% note %}
Note: If a ruleset was created at the organization level, you cannot edit the ruleset from the repository's settings. If you have permission to edit the ruleset, you can do so in your organization's settings. For more information, see "AUTOTITLE."
{% endnote %} {% endif %}
{% data reusables.repositories.about-editing-rulesets %}
{% data reusables.repositories.navigate-to-repo %} {% data reusables.repositories.sidebar-settings %} {% data reusables.repositories.repo-rulesets-settings %} {% data reusables.repositories.edit-ruleset-steps %}
{% data reusables.repositories.deleting-ruleset-tip %}
{% data reusables.repositories.navigate-to-repo %} {% data reusables.repositories.sidebar-settings %} {% data reusables.repositories.repo-rulesets-settings %} {% data reusables.repositories.delete-ruleset-steps %}
{% ifversion repo-rules-management %}
{% data reusables.repositories.ruleset-beta-note %}
{% data reusables.repositories.ruleset-history-conceptual %}
{% data reusables.repositories.navigate-to-repo %} {% data reusables.repositories.sidebar-settings %} {% data reusables.repositories.repo-rulesets-settings %} {% data reusables.repositories.ruleset-history %}
{% data reusables.repositories.import-a-ruleset-conceptual %}
{% data reusables.repositories.navigate-to-repo %} {% data reusables.repositories.sidebar-settings %} {% data reusables.repositories.repo-rulesets-settings %} {% data reusables.repositories.import-a-ruleset %}
{% endif %}
{% ifversion repo-rules-enterprise %}
You can view insights for rulesets to see how rulesets are affecting a repository. {% data reusables.repositories.about-ruleset-insights %}
{% data reusables.repositories.navigate-to-repo %} {% data reusables.repositories.sidebar-settings %}
-
In the left sidebar, under "Code and automation," click Rules, then click Insights.
-
On the "Rule Insights" page, use the dropdown menus at the top of the page to filter the actions by ruleset, branch, actor, and time period. {% data reusables.repositories.rulesets-view-rule-runs %} {%- ifversion repo-rules-merge-queue %}
-
Optionally, review merge queue details for corresponding pull requests in the same merge group.
{% endif %}
{% endif %}
{% ifversion push-rule-delegated-bypass %}
{% data reusables.repositories.managing-delegated-bypass %}
{% endif %}