Skip to main content

为企业中的代码扫描配置自托管式运行器

无需使用 GitHub 托管式运行器,即可为企业启用、配置和禁用 code scanning。 用户使用 Code scanning 可以扫描代码以发现漏洞和错误。

谁可以使用此功能?

Code scanning 可用于以下存储库类型:

  • GitHub.com 上的公共存储库
  • GitHub Team、GitHub Enterprise Cloud 或 GitHub Enterprise Server 上的组织拥有的存储库,已启用 GitHub Code Security

Provisioning a self-hosted runner

注意

GitHub can run code scanning using a GitHub Actions workflow. First, you need to provision one or more self-hosted GitHub Actions runners in your environment. You can provision self-hosted runners at the repository, organization, or enterprise account level. See Self-hosted runners and Adding self-hosted runners.

If you are provisioning a self-hosted runner for CodeQL analysis, your runner must use a CodeQL-supported operating system version and CPU architecture. See the CodeQL system requirements.

If you are using default setup for code scanning, you can assign self-hosted runners with the default code-scanning label, or you can optionally give them custom labels so that individual repositories can use different runners. See Configuring default setup for code scanning.

For information about using default setup for code scanning analysis of compiled languages, see CodeQL code scanning for compiled languages.

You must ensure that Git is in the PATH variable on any self-hosted runners you use to run CodeQL actions.

注意

If you use CodeQL code scanning to analyze code written in Python in your enterprise, you must make sure that your self-hosted runner has Python 3 installed.