Black Friday: 79% off every plugin Shop the sale →

CI Integration

Use --fail-on to make a build fail when serious findings exist. The command exits with status 1 and prints an error such as Error: 2 finding(s) at or above "high".

Example#

A minimal step for any CI system that can run WP-CLI against a test WordPress install:

# Fail the job on high or critical findings. Do not pollute History.
wp ability-audit run --fail-on=high --no-save

For a stricter policy on your own plugin’s abilities, fail on medium so missing annotations and loose input schemas are caught before release:

wp ability-audit run --fail-on=medium --no-save

Keeping a report artifact#

Combine a human-readable run with a saved JSON report:

wp ability-audit run --format=json --no-save > ability-audit.json
wp ability-audit run --fail-on=high --no-save

Tips#

  • Run the audit after every plugin you depend on is active, otherwise their abilities are not registered and cannot be checked.
  • --fail-on counts findings at the given severity and above. --fail-on=info fails whenever any ability is exposed, which is rarely what you want.
  • Use --no-save in CI so the test site’s History does not fill up with throwaway runs.
Was this article helpful?