Expose a parameter determining the minimum level that will trigger a build failure
By default, spectral-action will fail the check when at least one error has been discovered. However, warnings for instance will generate annotations without failing the check.
Spectral exposes a flag that determine the minimum severity level that will trigger a failure.
Surfacing the parameter might be interesting to provide a better control to spectral-action users.
This is much needed!
I'm also interested in this feature. As part of the CI action, I'd like Spectral to incorporate the --fail-severity=info option so that all output (other than "hint") will lead to some sort of discussion/fix in the PR. Are there any workarounds? Manually editing the style guide to set all "info" and "warning" level rules to "error" isn't a good option.
Edit: I ended up working around this by manually installing and running Spectral in my GitHub Actions workflow:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
# Check out repository under $GITHUB_WORKSPACE
- uses: actions/checkout@v3
# Install Spectral
- id: install_spectral
run: npm install -g @stoplight/spectral-cli
# Run Spectral
- id: run_spectral
run: spectral lint ./reference/*.{json,yml,yaml} --fail-severity=info