Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose a parameter determining the minimum level that will trigger a build failure #183

Open
nulltoken opened this issue Apr 29, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@nulltoken
Copy link
Contributor

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.

@dahu33
Copy link

dahu33 commented Sep 15, 2021

This is much needed!

@br-tyler-milner
Copy link

br-tyler-milner commented Aug 9, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants