Prerequisites
If you get access to Copilot through an organization or enterprise, your organization or enterprise owner needs to enable preview features for Copilot 代码评审. See 管理组织中的 GitHub Copilot 策略和功能 and 管理企业中 GitHub Copilot 的策略和功能.
Managing static analysis tools for your repository
-
在 GitHub 上,导航到存储库的主页面。
-
在仓库名称下,单击 “Settings”****。 如果看不到“设置”选项卡,请选择“”下拉菜单,然后单击“设置”。

-
在左侧边栏的“代码和自动化”下,单击“规则”,然后单击“规则集” 。

-
Edit or create a ruleset for Copilot 代码评审:
- If you have configured a ruleset for automatic reviews from Copilot 代码评审, click the name of that ruleset.
- If you do not have an existing ruleset for Copilot 代码评审, select the New ruleset dropdown menu, then click New branch ruleset and give your ruleset a name.
-
In the "Rules" section, select Manage static analysis tools in Copilot 代码评审.
-
To update the tools that Copilot 代码评审 will use, select the Select tools dropdown menu, then select or deselect the available tools.
-
To apply your selections, at the bottom of the page, click Create or Save changes.
Configuring static analysis tools for your organization
-
在 GitHub 上,导航到组织的主页面。
-
在组织名称下,单击 “Settings”****。 如果看不到“设置”选项卡,请选择“”下拉菜单,然后单击“设置”********。

-
在左边栏的“Code, planning, and automation”部分,单击“ Repository”,然后单击“Rulesets”********。

-
Edit or create a ruleset for Copilot 代码评审:
- If you have configured a ruleset for automatic reviews from Copilot 代码评审, click the name of that ruleset.
- If you do not have an existing ruleset for Copilot 代码评审, select the New ruleset dropdown menu, then click New branch ruleset and give your ruleset a name.
-
In the "Rules" section, select Manage static analysis tools in Copilot 代码评审.
-
To update the tools that Copilot 代码评审 will use, select the Select tools dropdown menu, then select or deselect the available tools.
-
To apply your selections, at the bottom of the page, click Create or Save changes.