You want the workflow to post test coverage on the PR and fail if coverage drops below 80%.
IntermediateScenarioGitHub Actions
Answer
Situation read → Quality gate in CI.
What I'd do →
- Generate coverage (
pytest --cov --cov-fail-under=80or JaCoCo check rule). - Upload report as artifact and publish a summary to
$GITHUB_STEP_SUMMARY. - Make the job a required status check in branch protection or rulesets.
Why → The tool's own threshold fails the step; branch protection makes the failure block merge.
Interview tip → Prefer "no drop on changed code" to a flat global threshold.
More on GitHub Actions
What are workflows, jobs, steps and actions in GitHub Actions?BeginnerWhat events can trigger a workflow?BeginnerWhat is the difference between `pull_request` and `pull_request_target`?AdvancedWhat is a runner, and how do GitHub-hosted and self-hosted runners differ?BeginnerHow do you pass data between steps and between jobs?IntermediateHow does a build matrix work?Intermediate