| title | Configuring advanced setup for code scanning with CodeQL at scale | ||||||
|---|---|---|---|---|---|---|---|
| shortTitle | CodeQL advanced setup at scale | ||||||
| intro | Establish a highly customizable {% data variables.product.prodname_code_scanning %} setup at scale with a script. | ||||||
| permissions | {% data reusables.permissions.security-org-enable %} | ||||||
| product | {% data reusables.gated-features.code-scanning %} | ||||||
| redirect_from |
|
||||||
| versions |
|
||||||
| topics |
|
||||||
| allowTitleToDifferFromFilename | true | ||||||
| contentType | how-tos |
For repositories that are not eligible for default setup, you can use a bulk configuration script to enable advanced setup across multiple repositories.
[!NOTE] To successfully execute the script, {% data variables.product.prodname_actions %} must be enabled for the {% ifversion fpt %}organization{% elsif ghec %}organization or enterprise{% elsif ghes %}instance{% endif %}.
- Identify a group of repositories that can be analyzed using the same {% data variables.product.prodname_code_scanning %} configuration. For example, all repositories that build Java artifacts using the production environment.
- Create and test a {% data variables.product.prodname_actions %} workflow to call the {% data variables.product.prodname_codeql %} action with the appropriate configuration. For more information, see AUTOTITLE.
- Use one of the example scripts or create a custom script to add the workflow to each repository in the group.
- GitHub CLI extension:
advanced-security/gh-add-files - Python example:
Malwarebytes/ghas-clirepository - NodeJS example:
nickliffen/ghas-enablementrepository - PowerShell example:
jhutchings1/Create-ActionsPRsrepository
- GitHub CLI extension:
{% data reusables.code-scanning.beta-model-packs %}
If your codebase depends on a library or framework that is not recognized by the standard queries in {% data variables.product.prodname_codeql %}, you can extend the {% data variables.product.prodname_codeql %} coverage in your bulk configuration script by specifying published {% data variables.product.prodname_codeql %} model packs. For more information, see AUTOTITLE.