Failing the build
The action is advisory by default: blocking is none and min-score is
unset. A fresh install comments, annotates, and sets a status without turning a
pull request red.
Two independent gates decide the outcome, and either one failing fails the run.
Turn both on in .github/workflows/nestjs-doctor.yml:
- uses: RoloBits/nestjs-doctor@v1
with:
blocking: error
min-score: 80Drop either input to use only the other gate.
blocking: gate on findings
Gates on the findings the run reported, which the scope input decides. With
the default scope: changed, that is only what the pull request introduced.
| Level | Fails when |
|---|---|
none | Never. The default; report only |
warning | Any error or warning is reported |
error | Any error is reported |
Because it follows the scope, a repository with a thousand pre-existing findings
can adopt blocking: error on day one. The gate only ever sees what each pull
request adds, so nobody inherits somebody else's backlog.
min-score: gate on the score
Gates on the 0-100 health score, which always reflects the whole project,
whatever scope says. Set a number and the run fails whenever the score falls
below it.
The two gates measure different things: blocking sees the reported scope,
min-score the whole project. A pull request touching one file can fail on
debt somewhere else. Use blocking alone for new code, and add min-score
for a floor on the repository as a whole.
Setting the threshold in config instead
minScore is also a config-file key. Carry the floor in
nestjs-doctor.config.json and local runs, the pre-commit hook, and CI all
agree on it:
{
"minScore": 75
}The action's min-score input overrides the config value when set. Leave it
empty and the config value applies.
Which findings count
Both gates count what the run reports. Three levers take a finding out of the count:
- A report-only rule appears in the report and counts toward neither gate.
security/no-advisory-nestjs-packagesworks this way, commenting on the pull request while never failing a build. See Surfaces. - A rule or category disabled in the config file stops counting toward either gate. See Configuration.
- An inline
nestjs-doctor-ignorecomment suppresses the finding entirely, so it is never reported.
Point the action at a CI-specific file with the config input to hold CI
stricter than local runs. Both gates are CLI flags too. See
Gates.
Exit codes
Only a pull_request event is gated. Every other event exits 0, whatever the
gates say. See Runs outside a pull request
and Exit codes.