Nota:
This feature is in versión preliminar pública and subject to change.
Prerequisites
- GitHub Code Quality is enabled on the repository.
- Code coverage data is uploaded to GitHub for the pull request branch. See Configurar la cobertura de código para tu repositorio.
Creating a coverage threshold rule
-
En GitHub, navegue hasta la página principal del repositorio.
-
Debajo del nombre del repositorio, haz clic en Settings. Si no puedes ver la pestaña "Configuración", selecciona el menú desplegable y, a continuación, haz clic en Configuración.

-
En la barra lateral izquierda, en "Código y automatización", haz clic en Reglas y, a continuación, haz clic en Conjuntos de reglas.

-
Create a new branch ruleset or click an existing one to edit it.
-
Under "Branch rules", select Restrict code coverage.
-
Expand Additional settings to configure thresholds. A value of 0 means that the threshold is disabled.
- Minimum coverage percentage: enter a value to block pull requests where aggregated coverage falls below this percentage.
- Maximum coverage drop: enter a value to block pull requests where coverage drops by more than this many percentage points relative to the default branch.
-
Click Create or Save changes.
Sugerencia
Consider setting your ruleset to Evaluate mode before switching to Active. This lets you observe which pull requests would have been blocked without enforcing the rule, giving you a chance to calibrate your thresholds.