Note: Code scanning is currently in beta and subject to change. If your organization has an Advanced Security license, you can join the beta program.
Note: Your site administrator must enable code scanning for your GitHub Enterprise Server instance before you can use this feature. If you want to use GitHub Actions to scan your code, the site administrator must also enable GitHub Actions and set up the infrastructure required. For more information, see "Configuring code scanning for your appliance."
You decide how you generate code scanning alerts, and which tools you use, at a repository level. GitHub Enterprise provides fully integrated support for CodeQL analysis, and also supports analysis using third-party tools. For more information, see "About CodeQL."
|Options for generating alerts|
|CodeQL||Using GitHub Actions (see "Enabling code scanning using actions") or using the CodeQL runner in a third-party continuous integration (CI) system (see "Running code scanning in your CI system").|
|Third‑party||Using GitHub Actions (see "Enabling code scanning using actions") or generated externally and uploaded to GitHub Enterprise (see "Uploading a SARIF file to GitHub").|
- On GitHub Enterprise, navigate to the main page of the repository.
- Under your repository name, click Security.
- To the right of "Code scanning", click Set up code scanning.
- Under "Get started with code scanning", click Set up this workflow on the CodeQL Analysis workflow or on a third-party workflow.
- Optionally, to customize how code scanning scans your code, edit the workflow. For more information, see "Configuring code scanning."
- Use the Start commit drop-down, and type a commit message.
- Choose whether you'd like to commit directly to the default branch, or create a new branch and start a pull request.
- Click Commit new file or Propose new file.
After you commit the workflow file or create a pull request, code scanning will analyze your code according to the frequency you specified in your workflow file. If you created a pull request, code scanning will only analyze the code on the pull request's topic branch until you merge the pull request into the default branch of the repository.
After you enable code scanning, you can monitor analysis, view results, and further customize how you scan your code.
- You can view the run status of code scanning and get notifications for completed runs. For more information, see "Managing a workflow run" and "Configuring notifications."
- After a scan completes, you can view alerts from a completed scan. For more information, see "Managing alerts from code scanning."
- You can customize how code scanning scans the code in your repository. For more information, see "Configuring code scanning."