GitHub - github/codeql-action: Actions for running CodeQL analysis (original) (raw)

CodeQL Action

This action runs GitHub's industry-leading semantic code analysis engine, CodeQL, against a repository's source code to find security vulnerabilities. It then automatically uploads the results to GitHub so they can be displayed on pull requests and in the repository's security tab. CodeQL runs an extensible set of queries, which have been developed by the community and the GitHub Security Lab to find common vulnerabilities in your code.

For a list of recent changes, see the CodeQL Action's changelog.

License

This project is released under the MIT License.

The underlying CodeQL CLI, used in this action, is licensed under the GitHub CodeQL Terms and Conditions. As such, this action may be used on open source projects hosted on GitHub, and on private repositories that are owned by an organisation with GitHub Advanced Security enabled.

Usage

We recommend using default setup to configure CodeQL analysis for your repository. For more information, see "Configuring default setup for code scanning."

You can also configure advanced setup for a repository to find security vulnerabilities in your code using a highly customizable code scanning configuration. For more information, see "Configuring advanced setup for code scanning" and "Customizing your advanced setup for code scanning."

Actions

This repository contains several actions that enable you to analyze code in your repository using CodeQL and upload the analysis to GitHub Code Scanning. Actions in this repository also allow you to upload to GitHub analyses generated by any SARIF-producing SAST tool.

Actions for CodeQL analyses:

Actions for uploading analyses generated by third-party tools:

Actions with special purposes and unlikely to be used directly:

Workflow Permissions

All advanced setup code scanning workflows must have the security-events: write permission. Workflows in private repositories must additionally have the contents: read permission. For more information, see "Assigning permissions to jobs."

Build Modes

The CodeQL Action supports different build modes for analyzing the source code. The available build modes are:

Which build mode should I use?

Interpreted languages must use none for the build mode.

For compiled languages:

Supported versions of the CodeQL Action

The following versions of the CodeQL Action are currently supported:

Supported versions of the CodeQL Bundle on GitHub Enterprise Server

We typically release new minor versions of the CodeQL Action and Bundle when a new minor version of GitHub Enterprise Server (GHES) is released. When a version of GHES is deprecated, the CodeQL Action and Bundle releases that shipped with it are deprecated as well.

Minimum CodeQL Action Minimum CodeQL Bundle Version GitHub Environment Notes
v3.26.6 2.18.4 Enterprise Server 3.15
v3.25.11 2.17.6 Enterprise Server 3.14
v3.24.11 2.16.6 Enterprise Server 3.13
v3.22.12 2.15.5 Enterprise Server 3.12

See the full list of GHES release and deprecation dates at GitHub Enterprise Server releases.

Troubleshooting

Read about troubleshooting code scanning.

Contributing

This project welcomes contributions. See CONTRIBUTING.md for details on how to build, install, and contribute.