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

fix: Lychee output to file (fixes #214) #215

Closed joryirving closed 6 months ago

joryirving commented 6 months ago

Currently it evaluates the first if [ ! -f "${LYCHEE_TMP}" ]; then, however it skips the second one that's essentially the same check. This combines them into a single if/else statement so it should start being evaluated.

Fixes #214

mre commented 6 months ago

Thanks for the PR. Did you test it already on a fork? Also, I wonder if we need to add another test for the behavior or not.

joryirving commented 6 months ago

I have not tested it, unfortunately. I haven't found the time yet, sorry.

tooomm commented 6 months ago

This should then also address #216.

joryirving commented 6 months ago

I'm going to follow up with I'm not 100% sure how to test a forked GHA.

tooomm commented 6 months ago

@LilDrunkenSmurf You should be able to run the new version with output/print commands in an action targeting your branch with the changes. Maybe try this in your fork (I don't think it's required to release an action to use it):

uses: LilDrunkenSmurf/lychee-action@output-fix
joryirving commented 6 months ago

It appears to have solved the issue: https://github.com/LilDrunkenSmurf/k3s-home-cluster/actions/runs/7389528816/job/20102556052

https://github.com/LilDrunkenSmurf/k3s-home-cluster/blob/82e612889c2f87e38f55bf97f4e1e5273b05aa82/.github/workflows/lychee-test.yaml

mre commented 6 months ago

Thanks for the contribution. I merged the changes and they should be live in @master in a bit.

mre commented 6 months ago

I plan to do a release of the action very soon. Then we should also have the fix with a proper release version.