Skip to main content

关于与代码扫描的集成

可以在外部执行 code scanning,然后在 GitHub 中显示结果,或者配置侦听存储库中 code scanning 活动的 Webhook。

谁可以使用此功能?

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

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

About integration with code scanning

注意

Your site administrator must enable code scanning before you can use this feature. For more information, see Configuring code scanning for your appliance.

You may not be able to enable or disable code scanning if an enterprise owner has set a GitHub Code Security policy at the enterprise level. For more information, see Enforcing policies for code security and analysis for your enterprise.

As an alternative to running code scanning within GitHub, you can perform analysis elsewhere, using the CodeQL CLI or another static analysis tool, and then upload the results. For more information, see Using code scanning with your existing CI system.

If you run code scanning using multiple configurations, an alert will sometimes have multiple analysis origins. If an alert has multiple analysis origins, you can view the status of the alert for each analysis origin on the alert page. For more information, see About code scanning alerts.

Integrations with webhooks

You can use code scanning webhooks to build or configure integrations, such as GitHub Apps or OAuth apps, that subscribe to code scanning events in your repository. For example, you could build an integration that creates an issue on GitHub or sends you a Slack notification when a new code scanning alert is added in your repository. For more information, see Webhooks documentation and Webhook events and payloads.

Further reading