|
| 1 | +--- |
| 2 | +title: About setup types for code scanning |
| 3 | +shortTitle: Setup types |
| 4 | +intro: Depending on your needs, {% data variables.product.github %} offers a default or advanced setup for code scanning. |
| 5 | +topics: |
| 6 | + - Code Security |
| 7 | + - Code scanning |
| 8 | +versions: |
| 9 | + fpt: '*' |
| 10 | + ghes: '*' |
| 11 | + ghec: '*' |
| 12 | +contentType: concepts |
| 13 | +--- |
| 14 | + |
| 15 | +## About default setup |
| 16 | + |
| 17 | +Default setup for {% data variables.product.prodname_code_scanning %} is the quickest, easiest, most low-maintenance way to enable {% data variables.product.prodname_code_scanning %} for your repository. Based on the code in your repository, default setup will automatically create a custom {% data variables.product.prodname_code_scanning %} configuration. After enabling default setup, the code written in {% data variables.product.prodname_codeql %}-supported languages in your repository will be scanned: |
| 18 | + |
| 19 | +* On each push to the repository's default branch, or any protected branch. For more information on protected branches, see [AUTOTITLE](/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches). |
| 20 | +* When creating or committing to a pull request based against the repository's default branch, or any protected branch, excluding pull requests from forks. |
| 21 | +* On a weekly schedule. |
| 22 | + |
| 23 | +If you need more granular control over your {% data variables.product.prodname_code_scanning %} configuration, you should instead configure advanced setup. |
| 24 | + |
| 25 | +### Supported languages |
| 26 | + |
| 27 | +{% data reusables.code-scanning.default-setup-pre-enablement-explanation %} |
| 28 | + |
| 29 | +If the code in a repository changes to include any {% data variables.product.prodname_codeql %}-supported languages, {% data variables.product.prodname_dotcom %} will automatically update the {% data variables.product.prodname_code_scanning %} configuration to include the new language. If {% data variables.product.prodname_code_scanning %} fails with the new configuration, {% data variables.product.prodname_dotcom %} will resume the previous configuration automatically so the repository does not lose {% data variables.product.prodname_code_scanning %} coverage. |
| 30 | + |
| 31 | +### Available runners |
| 32 | + |
| 33 | +You can use default setup for all {% data variables.product.prodname_codeql %}-supported languages on self-hosted runners or {% data variables.product.prodname_dotcom %}-hosted runners. |
| 34 | + |
| 35 | +You can assign self-hosted runners for default setup by giving the runners {% ifversion code-scanning-default-setup-customize-labels %}the default `code-scanning` label, or you can optionally give them custom labels so that individual repositories can use different runners.{% else %}the `code-scanning` label.{% endif %} |
| 36 | + |
| 37 | +{% ifversion code-scanning-default-setup-customize-labels %} |
| 38 | + |
| 39 | +Unless you have a specific use case, we recommend that you only assign runners with the default `code-scanning` label. However, you may want to use custom labels to: |
| 40 | + |
| 41 | +* Assign more powerful self-hosted runners to critical repositories for faster {% data variables.product.prodname_code_scanning %} analysis. |
| 42 | +* Run your {% data variables.product.prodname_code_scanning %} analyses on a particular platform (for example, macOS). |
| 43 | +* Have granular control over the workload for your {% data variables.product.prodname_dotcom %}-hosted runners and self-hosted runners. |
| 44 | + |
| 45 | +{% endif %} |
| 46 | + |
| 47 | +## About advanced setup |
| 48 | + |
| 49 | +Advanced setup for {% data variables.product.prodname_code_scanning %} is helpful when you need to customize your {% data variables.product.prodname_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. |
| 50 | + |
| 51 | +{% ifversion fpt or ghec %} |
| 52 | +You can also configure {% data variables.product.prodname_code_scanning %} with third-party tools. |
| 53 | + |
| 54 | +{% else %} |
| 55 | +Your site administrator can also make third-party actions available to users for {% data variables.product.prodname_code_scanning %}, by setting up {% data variables.product.prodname_github_connect %}. For more information, see [AUTOTITLE](/admin/code-security/managing-github-advanced-security-for-your-enterprise/configuring-code-scanning-for-your-appliance#configuring-github-connect-to-sync-github-actions). |
| 56 | +{% endif %} |
| 57 | + |
| 58 | +{% data reusables.code-scanning.about-multiple-configurations-link %} |
| 59 | + |
| 60 | +## Next steps |
| 61 | + |
| 62 | +You can enable default setup for a single repository, multiple repositories, or all repositories in an organization at the same time. |
| 63 | + |
| 64 | +* For a single repository, see [AUTOTITLE](/code-security/how-tos/scan-code-for-vulnerabilities/configure-code-scanning/configuring-default-setup-for-code-scanning). |
| 65 | +* For bulk enablement, see [AUTOTITLE](/code-security/code-scanning/enabling-code-scanning/configuring-default-setup-for-code-scanning-at-scale). |
| 66 | + |
| 67 | +To configure advanced setup instead, see [AUTOTITLE](/code-security/how-tos/scan-code-for-vulnerabilities/configure-code-scanning/configuring-advanced-setup-for-code-scanning). |
0 commit comments