stoplightio / spectral-action

GitHub Action wrapper for Spectral - a JSON/YAML/OpenAPI/AsyncAPI/etc linter with custom rule support.
https://stoplight.io/open-source/spectral
Apache License 2.0
85 stars 46 forks source link

Running the Spectrial action shows warnings but still passes #626

Open MarshallAsch opened 2 years ago

MarshallAsch commented 2 years ago

User story.

As a Developer I can do have warnings be reported as errors, so that the pipeline will fail so I know to fix them.

Is your feature request related to a problem?

Github actions only support a success and failure state, however spectral has support for warnings that get ignored. Having an option to to have the warnings be reported as failures could be beneficial to cause the pipeline to fail to draw attention to the potential issue.

Describe the solution you'd like

The option to return an error status from an action when any warnings are present.

Additional context

Sample of the warnings being applied but the pipeline showing as passing image

PR Check not showing the presents of any warnings image

Shmuppel commented 2 years ago

same as #183 , and I definitely agree, it's a huge bummer that this isn't implemented

ajrice6713 commented 2 years ago

You can resolve this by writing a custom ruleset to throw failures instead of warnings for specific things (like missing fields)

I think it was a desired behavior to pass on warnings and fail on errors - IMO that makes sense to me

aharpervc commented 1 year ago

Is it possible to have warnings show up as code comments rather than in the action log?