注意
GitHub Code Quality 当前正处于 公共预览版 阶段,并可能会发生变化。 在 公共预览版期间,Code Quality 不会计费,尽管 Code Quality 扫描将使用 GitHub Actions 分钟。
Overview
GitHub Code Quality helps you ensure your codebase is reliable, maintainable, and efficient. Whether you're building a new feature, reducing technical debt, or reporting on repository health, Code Quality provides actionable insights and automated fixes so you can improve and maintain the code health of your repository efficiently.
Key features and benefits
With Code Quality, you can:
- Identify code quality risks and opportunities in pull requests and through repository scans.
- Review clear explanations for findings and apply one-click Copilot-powered autofixes.
- Use repository dashboards to track reliability and maintainability scores, identify areas needing attention, and prioritize remediation.
- Set up rulesets for pull requests to enforce code quality standards and block changes that do not meet your criteria.
- Easily assign remediation work to Copilot 编码智能体, if you have a Copilot license.
Availability and usage costs
GitHub Code Quality is available for organization-owned repositories on GitHub Team and GitHub Enterprise Cloud plans.
GitHub Code Quality won't be billed during public preview. However, Code Quality scans will consume GitHub Actions minutes. See GitHub Code Quality 计费.
注意
- You don't need a Copilot or a Code Security license to use Code Quality or apply Copilot-powered autofixes.
- During the 公共预览版, an enterprise policy that blocks the use of Code Security by repository owners will also block use of Code Quality. See 允许在企业中使用 GitHub Code Quality。.
Supported languages
Code Quality performs rule-based analysis of the following languages using CodeQL:
- C#
- Go
- Java
- JavaScript
- Python
- Ruby
- TypeScript
Code Quality also performs AI-powered analysis with results displayed separately on the "AI 发现" repository dashboard. Unlike the rule-based CodeQL analysis that scans the entire codebase and pull requests, this AI-powered analysis only examines files recently pushed to the default branch and may identify issues in languages beyond those listed above. For more information, see 负责任地使用 GitHub 代码质量工具.
Understanding where Code Quality findings appear after enablement
Once you enable Code Quality for a repository, you'll see CodeQL scans for:
- Every new pull request opened against the default branch
- All existing pull requests to the default branch when they are updated, triggering a new run of CI tests
- The whole codebase on the default branch at the time and date shown on the "代码质量" settings page
In addition, you'll see an AI-powered analysis of all recent pushes to the default branch.
Pull request results
When CodeQL finds rule-based problems on pull requests, you'll see comments from the github-code-quality[bot]. Where possible, each comment will include a Copilot Autofix suggestion on how to fix the problem. See 在合并拉取请求之前修复代码质量问题.
Default branch results
Code Quality findings on the default branch are reported on "代码质量" pages on the Security tab for the repository:
- 常规发现 shows the results of CodeQL quality analysis. See 提高存储库代码的质量.
- AI 发现 shows the results of AI-powered analysis of the files most recently pushed to the default branch. See 使用 AI 提高最近合并代码的质量.
Scan information
Each CodeQL analysis will use GitHub Actions minutes and can be seen on the Actions tab of the repository as a run of the dynamic "代码质量" workflow.
Next steps
- Enable Code Quality for your repository, see 启用 GitHub Code Quality. Enterprise owners may need to first update their Advanced Security policies, see 允许在企业中使用 GitHub Code Quality。
- See how GitHub Code Quality works on your default branch to surface code quality issues and help you understand your repository's code health at a glance. See GitHub Code Quality 快速入门.