lycheeverse / lychee-action

Github action to check for broken links in Markdown, HTML, and text files using lychee, a fast link checker written in Rust.
https://lychee.cli.rs
Apache License 2.0
292 stars 39 forks source link

Always create output file; not only on error #199

Closed mre closed 1 year ago

mre commented 1 year ago

In https://github.com/lycheeverse/lychee-action/issues/198, user @jasongitmail mentioned that the JSON output file was missing when setting --format json. In fact, we only create an output file in case the GitHub action run was not successful (exit code != 0). This PR changes that.

We now unconditionally write an output file. Since the file should automatically be cleaned up after the run, there should be no negative side effects. I've added a test to make sure this functionality doesn't break in the future.