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

Failed to read file #18

Closed
Sh3Rm4n opened this issue Mar 2, 2021 · 5 comments
Closed

Failed to read file #18

Sh3Rm4n opened this issue Mar 2, 2021 · 5 comments

Comments

@Sh3Rm4n
Copy link

Sh3Rm4n commented Mar 2, 2021

Hey first of, thank you for this awesome tool. It is definitely quicker than the alternatives with comparable feature sets.

I'm really not sure, if the bug / issue I'm describing is part of lychee-action or the lychee repo, so feel free to move the issue, if this is not the right place.

I'm currently trying to get lychee-actions working here: stm32-rs/stm32f3xx-hal#188

Now I've tried a bit and stumbled upon #10

You can see my attempts here:

I've tried around, because I wasn't sure, if lychee is getting the arguments right. I've run these commands locally with the newest lychee version from master, and they work as expected.
Now stm32-rs/stm32f3xx-hal@36936e7 is particularly interesting, because it fails like that:

+ lychee --verbose --output /tmp/lychee/out.md
Error: Failed to read file: `README.md`

Caused by:
    No such file or directory (os error 2)

(https://github.com/stm32-rs/stm32f3xx-hal/runs/2010954174)

which does hint towards a right direction: This invocation and the ones before do nothing, because no matching file was found in the repo. In this case an explicit error is return, because lychee defaults to README.md if no file-name is given.

I've no clue, why github-action does not find any valid files, so I assume this is a github-actions issue and more so a configuration issue of lychee-action?

Maybe I'm wrong though, and it is an issue on my side, but I can't see it.

Also, even though the exit code is 1 the check is marked as successfully passed.

@pawroman
Copy link
Member

pawroman commented Mar 2, 2021

Hi,

I think you're missing the checkout step. GitHub Actions requires an explicit checkout to have the code available in further CI steps.

Please see an example of a working setup in my repo here: https://github.com/pawroman/links/blob/master/.github/workflows/main.yml#L14-L27

@Sh3Rm4n
Copy link
Author

Sh3Rm4n commented Mar 2, 2021

Thank you very much @pawroman, your suggestion did the trick.
In hindsight, it's obvious that the checkout step was missing.

Have I fully read the README, the solution is right there: https://github.com/lycheeverse/lychee-action/blob/master/README.md#receiving-issues-containing-the-error-report

But to be honest, I've only read until this header: https://github.com/lycheeverse/lychee-action/blob/master/README.md#detailed-arguments-args-information

Maybe adding

    steps:
      - uses: actions/checkout@v2

to the first example in the README could help, so others do not make the same mistake as myself? 🙈

@mre
Copy link
Member

mre commented Mar 3, 2021

Fair point. Then again people can have an arbitrarily complex pipeline and lychee might only come up somewhere down the pipe. The first two snippets in the README.md wouldn't be complete with the checkout step either. The other two examples in the README.md are complete, but would probably have to be adapted for each project anyway.

The action is based on https://github.com/peter-evans/link-checker, which has the same layout. (Doesn't mean that it's great, but I liked that it was quite straightforward when I read it for the first time. Might be biased, though. 😆)

For the sake of simplicity, I'd opt for keeping the initial examples short to highlight the single additional step required to run lychee in any pipeline.
Thanks for using lychee, though. 👍

@mre mre closed this as completed Mar 3, 2021
@Sh3Rm4n
Copy link
Author

Sh3Rm4n commented Mar 3, 2021

For the sake of simplicity, I'd opt for keeping the initial examples short to highlight the single additional step required to run lychee in any pipeline.

I'm fine with this decision. My suggestion was mostly to cover up my mistake 😆

@mre
Copy link
Member

mre commented Mar 3, 2021

I like your sense of humor. 😄

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

No branches or pull requests

3 participants