@lssm-tech/action.pr
v2.7.29
Published
GitHub Action for ContractSpec PR checks
Downloads
54
Maintainers
Readme
@contractspec/action.pr
Website: https://contractspec.io
GitHub Action that runs ContractSpec validation checks on pull requests. Posts drift reports, validation results, and product views as PR comments.
What It Does
- Uses
@contractspec/lib.contracts-specfor contract definitions - Uses
@contractspec/bundle.workspacefor workspace analysis - Configured via
action.yml; nosrc/— logic lives in workspace bundle
Usage
name: ContractSpec PR
on: pull_request
jobs:
contractspec:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: lssm-tech/contractspec/packages/apps/action-pr@main
with:
generate-command: 'bun contractspec generate'Inputs
package-manager(default:bun) — Package manager to use (bun|npm|pnpm|yarn)working-directory(default:.) — Working directory for running commandsreport-mode(default:summary) — Report output mode (summary|comment|both|off)enable-drift(default:true) — Run drift detection after generatefail-on(default:any) — Fail on breaking, drift, any, or nevergenerate-command(default:bun contractspec generate) — Command to regenerate artifacts (required when enable-drift=true)validate-command— Override validation commandcontracts-dir— Directory containing contract specscontracts-glob— Glob pattern for contract specstoken(default:${{ github.token }}) — GitHub token for PR comments
Outputs
drift-detected— Whether drift was detectedbreaking-change-detected— Whether breaking changes were detectedvalidation-failed— Whether validation failed
Key Files
action.yml— GitHub Action definitionfixtures/— Test report data and validation fixtures.contractspec-ci/contracts.json— CI contract configuration
Local Commands
bun run test— bun test
Recent Updates
- Replace eslint+prettier by biomejs to optimize speed
- Stability
- Standardize tool naming to underscore notation
Notes
- Do not change
action.ymlinputs/outputs without updating downstream workflow consumers - Fixture files are used for CI testing — keep them valid
