Skip to main content
Skip to content

끌어오기 요청에 대한 코드 검사 임계값 설정

업로드된 코드 범위가 팀에 필요한 수준보다 낮을 때 끌어오기 요청이 병합되지 않도록 방지합니다.

누가 이 기능을 사용할 수 있나요?

관리자 역할이 있는 리포지토리 소유자, 조직 소유자 및 사용자

참고

This feature is in public preview and subject to change.

How the code coverage rule works

The Restrict code coverage rule evaluates uploaded line coverage data against the configured thresholds. It does not wait for coverage uploads to complete.

To prevent a pull request from being merged before all expected coverage results are available, make each status check associated with an expected coverage upload a required status check. This includes coverage uploaded from separate jobs or workflows.

For more information about line coverage, see Code coverage reference.

Prerequisites

Creating a coverage threshold rule

  1. On GitHub, navigate to the main page of the repository.

  2. Under your repository name, click Settings. If you cannot see the "Settings" tab, select the dropdown menu, then click Settings.

    Screenshot of a repository header showing the tabs. The "Settings" tab is highlighted by a dark orange outline.

  3. In the left sidebar, under "Code, planning, and automation", click Rulesets, then click Rulesets.

  4. Create a new branch ruleset or click an existing one to edit it.

  5. Under "Branch rules", select Restrict code coverage.

  6. Expand Additional settings to configure thresholds. A value of 0 means that the threshold is disabled.

    • Minimum line coverage percentage: enter a value to block pull requests where aggregated line coverage falls below this percentage.
    • Maximum line coverage drop: enter a value to block pull requests where line coverage drops by more than this many percentage points relative to the default branch.
  7. Click Create or Save changes.