Skip to main content

About integration with code scanning

You can perform code scanning externally and then display the results in GitHub, or set up webhooks that listen to code scanning activity in your repository.

Code scanning 可用于 上的所有公共存储库。 若要在组织拥有的专用存储库中使用 code scanning,必须具有 GitHub Advanced Security 许可证。 有关详细信息,请参阅“关于 GitHub Advanced Security”。

As an alternative to running code scanning within GitHub, you can perform analysis elsewhere and then upload the results. Alerts for code scanning that you run externally are displayed in the same way as those for code scanning that you run within GitHub. For more information, see "Managing code scanning alerts for your repository."

If you use a third-party static analysis tool that can produce results as Static Analysis Results Interchange Format (SARIF) 2.1.0 data, you can upload this to GitHub. For more information, see "Uploading a SARIF file to GitHub."

如果使用多个配置运行代码扫描,则有时警报会有多个分析源。 如果警报有多个分析源,你可在警报页上查看每个分析源的警报状态。 有关详细信息,请参阅“关于分析源”。

Integrations with webhooks

You can use code scanning webhooks to build or set up 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 Enterprise Cloud or sends you a Slack notification when a new code scanning alert is added in your repository. For more information, see "Creating webhooks" and "Webhook events and payloads."

Further reading