Set up a Pull Request Quality Gate
mainYou can block pull requests from being merged if they fail the Qodana quality gate.
Workflow Setup:
- Configure the Qodana Scan action to run on
pull_requestevents targeting your protected branch (e.g.,main). - Set a
fail-threshold(an integer) in the Qodana action configuration to define the maximum number of allowed problems.
GitHub Repository Settings:
- Go to Settings > Branches.
- Add or edit a Branch protection rule for your target branch.
- Enable Require status checks to pass before merging.
- Search for and select the
Qodanastatus check. - Save the rule.