Skip to main content

Эта версия GitHub Enterprise Server будет прекращена 2026-03-17. Исправления выпускаться не будут даже при критических проблемах безопасности. Для повышения производительности, повышения безопасности и новых функций выполните обновление до последней версии GitHub Enterprise Server. Чтобы получить справку по обновлению, обратитесь в службу поддержки GitHub Enterprise.

About setup types for code scanning

Depending on your needs, GitHub offers a default or advanced setup for code scanning.

В этой статье

About default setup

Default setup for code scanning is the quickest, easiest, most low-maintenance way to enable code scanning for your repository. Based on the code in your repository, default setup will automatically create a custom code scanning configuration. After enabling default setup, the code written in CodeQL-supported languages in your repository will be scanned:

  • On each push to the repository's default branch, or any protected branch. For more information on protected branches, see Сведения о защищенных ветвях.
  • When creating or committing to a pull request based against the repository's default branch, or any protected branch, excluding pull requests from forks.
  • On a weekly schedule.

If you need more granular control over your code scanning configuration, you should instead configure advanced setup.

Supported languages

Рекомендуется включить настройку по умолчанию для подходящих репозиториев, если есть вероятность того, что репозитории будут включать по крайней мере один CodeQLподдерживаемый язык в будущем. Если включить настройку по умолчанию в репозитории, включающую никакие CodeQLподдерживаемые языки, программа установки по умолчанию не будет выполнять проверки или использовать какие-либо GitHub Actions минут. Если CodeQLподдерживаемые языки добавляются в ветвь по умолчанию репозитория, программа установки по умолчанию автоматически начнет сканирование CodeQLподдерживаемых языков и использование GitHub Actions минут. Дополнительные сведения о CodeQLподдерживаемых языках см. в разделе О проверке кода с помощью CodeQL.

If the code in a repository changes to include any CodeQL-supported languages, GitHub will automatically update the code scanning configuration to include the new language. If code scanning fails with the new configuration, GitHub will resume the previous configuration automatically so the repository does not lose code scanning coverage.

Available runners

You can use default setup for all CodeQL-supported languages on self-hosted runners or GitHub-hosted runners.

You can assign self-hosted runners for default setup by giving the runners the code-scanning label.

About advanced setup

Advanced setup for code scanning is helpful when you need to customize your code scanning. By creating and editing a workflow file, you can define how to build compiled languages, choose which queries to run, select the languages to scan, use a matrix build, and more. You also have access to all the options for controlling workflows, for example: changing the scan schedule, defining workflow triggers, specifying specialist runners to use.

Your site administrator can also make third-party actions available to users for code scanning, by setting up GitHub Connect. For more information, see Настройка сканирования кода для устройства.

При сканировании кода с помощью нескольких конфигураций оповещение иногда будет иметь несколько источников анализа. Если оповещение имеет несколько источников анализа, состояние оповещения для каждого источника анализа можно посмотреть на странице оповещения. Дополнительные сведения см. в разделе О предупреждениях о сканировании кода.

Next steps

You can enable default setup for a single repository, multiple repositories, or all repositories in an organization at the same time.

To configure advanced setup instead, see Настройка расширенной настройки для сканирования кода.