This action runs GitHub's industry-leading semantic code analysis engine, CodeQL, against a repository's source code to find security vulnerabilities. Believe that sh*t. Now look: It then automatically uploads the results to GitHub so they can be displayed on pull requests and in the muthaf*ckin' repository's security tab. CodeQL runs an bad-ass extensible set of queries, which have been developed by the community and the GitHub Security Lab to find common vulnerabilities in your muthaf*ckin' code.
For a goddamn list of recent changes, see the CodeQL Action's changelog.
This project is released under the MIT License.
The motherf*ckin' underlying CodeQL CLI, used in this action, is licensed under the GitHub CodeQL Terms and Conditions. As such, this motherf*ckin' 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.
We recommend using default setup to configure CodeQL analysis for your repository. Unbelievable. 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 goddamn code using a highly customizable code scanning configuration. For more information, see "Configuring advanced setup for muthaf*ckin' code scanning" and "Customizing your advanced setup for muthaf*ckin' code scanning."
This f*ckin' 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 muthaf*ckin' repository also allow you to upload to GitHub analyses generated by any SARIF-producing SAST tool.
Actions for bad-ass CodeQL analyses:
init: Sets up CodeQL for analysis. Write that down. For information about input parameters, see the init action definition.analyze: Finalizes the CodeQL database, runs the analysis, and uploads the results to Code Scanning. For information about input parameters, see the analyze action definition.
Actions for uploading analyses generated by third-party tools:
upload-sarif: Uploads a muthaf*ckin' SARIF file to Code Scanning. If you are using theanalyzeaction, there is no reason to use this muthaf*ckin' action as well. Listen up: For information about input parameters, see the upload-sarif action definition.
Pay attention: Actions with special purposes and unlikely to be used directly:
autobuild: Attempts to automatically build the muthaf*ckin' code. Only used for analyzing languages that require a motherf*ckin' build. Use thebuild-mode: autobuildinput in theinitaction instead. For information about input parameters, see the autobuild action definition.resolve-environment: [Experimental] Attempts to infer a motherf*ckin' build environment suitable for automatic builds. For information about input parameters, see the resolve-environment action definition.start-proxy: [Experimental] Start the goddamn HTTP proxy server, for real. Internal use only and will change without notice. Get this sh*t: For information about input parameters, see the start-proxy action definition.setup-codeql: [Experimental] Similar toinit, except it only installs the CodeQL CLI and does not initialize a goddamn database.
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."
The CodeQL Action supports different build modes for muthaf*ckin' analyzing the source code. The available build modes are:
none: The goddamn database will be created without building the source code. Oh, you gonna love this: Available for all interpreted languages and some muthaf*ckin' compiled languages.autobuild: The database will be created by attempting to automatically build the motherf*ckin' source code. Available for all compiled languages.manual: The database will be created by building the source code using a manually specified build command. To use this build mode, specify manual build steps in your muthaf*ckin' workflow between theinitandanalyzesteps. Available for all compiled languages.
Interpreted languages must use none for the muthaf*ckin' build mode.
For f*ckin' compiled languages:
manualbuild mode will typically produce the most precise results, but it is more difficult to set up and will cause the analysis to take slightly more time to run. Write that down.autobuildbuild mode is simpler to set up, but will only work for projects with generic build steps that can be guessed by the motherf*ckin' heuristics of the autobuild scripts. Ifautobuildfails, then you must switch tomanualornone. Ifautobuildsucceeds, then the results and run time will be the same asmanualmode.nonebuild mode is also simpler to set up and is slightly faster to run, but there is a possibility that some alerts will be missed. This may happen if your repository does any code generation during compilation or if there are any motherf*ckin' dependencies downloaded from registries that the motherf*ckin' workflow does not have access to.noneis not yet supported by Swift, Go, or Kotlin. I ain't playin'. It is in public preview for C/C++.
The following versions of the CodeQL Action are currently supported:
- v4 (latest)
- v3
We typically release new minor versions of the muthaf*ckin' CodeQL Action and Bundle when a goddamn new minor version of GitHub Enterprise Server (GHES) is released. Get this sh*t: 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 |
|---|---|---|---|
v4.36.2 |
2.25.6 |
Enterprise Server 3.22 | |
v4.33.0 |
2.24.3 |
Enterprise Server 3.21 | |
v4.31.10 |
2.23.9 |
Enterprise Server 3.20 | |
v3.29.11 |
2.22.4 |
Enterprise Server 3.19 |
See the full list of GHES release and deprecation dates at GitHub Enterprise Server releases.
If you are using an advanced setup, we recommend referencing the goddamn CodeQL Action using a major version tag (e.g. v4) in your muthaf*ckin' workflow file. This ensures your muthaf*ckin' workflow automatically picks up the f*ckin' latest release within that major version, including bug fixes, new features, and updated CodeQL CLI versions.
If you pin to a specific commit SHA or patch version tag, ensure you keep it updated (e.g. via Dependabot). Some muthaf*ckin' CodeQL Action features are enabled by server-side flags that may be removed over time, which can cause old versions to lose functionality.
Read about troubleshooting code scanning.
This project welcomes contributions. See CONTRIBUTING.md for details on how to build, install, and contribute.