Skip to main content

Managing static analysis tools in Copilot code review

Improve your code security and linting configuration with static analysis tools in Copilot code review.

Who can use this feature?

Repository administrators and organization owners

Rulesets are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, and GitHub Enterprise Cloud.

Prerequisites

If you get access to Copilot through an organization or enterprise, your organization or enterprise owner needs to enable preview features for Copilot code review. See Managing policies and features for GitHub Copilot in your organization and Managing policies and features for GitHub Copilot in your enterprise.

Managing static analysis tools for your repository

  1. On GitHub, navigate to the main page of the repository.

  2. Under your repository name, click Settings. If you cannot see the "Settings" tab, select the dropdown menu, then click Settings.

    Screenshot of a repository header showing the tabs. The "Settings" tab is highlighted by a dark orange outline.

  3. In the left sidebar, under "Code and automation," click Rules, then click Rulesets.

    Screenshot of the sidebar of the "Settings" page for a repository. The "Rules" sub-menu is expanded, and the "Rulesets" option is outlined in orange.

  4. Edit or create a ruleset for Copilot code review:

    • If you have configured a ruleset for automatic reviews from Copilot code review, click the name of that ruleset.
    • If you do not have an existing ruleset for Copilot code review, select the New ruleset dropdown menu, then click New branch ruleset and give your ruleset a name.
  5. In the "Rules" section, select Manage static analysis tools in Copilot code review.

  6. To update the tools that Copilot code review will use, select the Select tools dropdown menu, then select or deselect the available tools.

  7. To apply your selections, at the bottom of the page, click Create or Save changes.

Configuring static analysis tools for your organization

  1. On GitHub, navigate to the main page of the organization.

  2. Under your organization name, click Settings. If you cannot see the "Settings" tab, select the dropdown menu, then click Settings.

    Screenshot of the tabs in an organization's profile. The "Settings" tab is outlined in dark orange.

  3. In the left sidebar, in the "Code, planning, and automation" section, click Repository, then click Rulesets.

    Screenshot of an organization's settings page. In the sidebar, a link labeled "Rulesets" is outlined in orange.

  4. Edit or create a ruleset for Copilot code review:

    • If you have configured a ruleset for automatic reviews from Copilot code review, click the name of that ruleset.
    • If you do not have an existing ruleset for Copilot code review, select the New ruleset dropdown menu, then click New branch ruleset and give your ruleset a name.
  5. In the "Rules" section, select Manage static analysis tools in Copilot code review.

  6. To update the tools that Copilot code review will use, select the Select tools dropdown menu, then select or deselect the available tools.

  7. To apply your selections, at the bottom of the page, click Create or Save changes.