redocly-cli
redocly-cli copied to clipboard
lint command report in github action annotations/pr
Hello,
We have a Github Action that controls our api documentation via redocly lint
command.
I'd like to put warnings and errors in the annotations of the Github Action, so that they can be displayed directly from our pull requests.
I can't find any clear documentation on this...
On another repo, we use eslint
and we have nothing to do, the errors/warining show up by themselves (it looks like stylish
).
I've tried every possible --format
of the lint
command, but nothing works.
I can't figure out how to output the report as a file and try to do something with another action dedicated to a specific format.
Describe the solution you'd like
I'd like errors/warning to show up on their own in the annotations when I run the lint command.
Describe alternatives you've considered
Export the result to a file. And process it with another Github action.
Additional context
Lint command:
npm run lint
npm run lint -- --format stylish
Npm scripts:
"scripts": {
"lint": "redocly lint my-file.yaml",
}
Eslint github action output:
Eslint github annotation:
Redocly lint github action output (stylish
format):
I assume your request is a duplicate of this one: https://github.com/Redocly/redocly-cli/issues/976 Feel free to reopen if you think it's different.
Not really. I found this issue. But for me, it's in the annotations, not the summary.
I can't reopen it :upside_down_face:
I'm pleased to let you know that this feature was introduced in #1497 and is available in Redocly CLI from version 1.11.0 onwards.
How to use it: where you have redocly lint my-file.yaml
, add a --format=github-actions
to the lint command and you should see annotations for any warnings or errors in that file.
I'll close the issue (otherwise we'll forget about it), but comments and feedback are welcome!