-
-
Notifications
You must be signed in to change notification settings - Fork 51
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
Lychee not detecting markdown files #68
Comments
This issue might have been better off in https://github.com/lycheeverse/lychee-action/issues instead. I thought I was opening it there, can admins transfer this to the other repository. |
So in summary, can you try quoting the glob until we publish a new version of the action? |
You got it, I created a PR following your suggestion: balena-io/docs#2168 |
Ran and approved your PR run: https://github.com/balena-io/docs/pull/2169/files |
I'm afraid that will probably not work. :/
I'm a bit out of ideas for the moment as to what this could be. |
See also: rust-lang/glob#83 We wanted to move to |
Glob patterns were not properly evaluated for three reasons: 1. Quotes around globs were not preserved. As a result, unquoted wildcards were evaluated by bash instead of lychee 2. `**` patterns handled by the [glob](https://github.com/rust-lang-nursery/glob) crate need to be prefixed with a separator, e.g. `./`. See code [here](https://github.com/rust-lang-nursery/glob/blob/master/src/lib.rs#L536) and [here](https://github.com/rust-lang-nursery/glob/blob/337d417ee872dc04e8e6faff4b7379141933df59/src/lib.rs#L583-L596). We should probably switch to [globset](https://github.com/BurntSushi/globset) at some point, which doesn't have that limitation. 3. The lychee command itself needs to be executed with `eval` to make it find links. Otherwise it interprets the input argument (`${ARGS[@]}`) as a string and tries to find links within that string. (String input is supported by lychee). We want to interpret it as individual (whitespace-separated) arguments however. **Usage inside pipelines: Surround glob patterns by single (!) quotes and prefix them with `./`.** ```yaml - name: Link Checker uses: lycheeverse/[email protected] with: # Check all Markdown and HTML files args: --verbose --no-progress './**/*.md' './**/*.html' ``` Fixes #68
@vipulgupta2048, #73 should fix it. It was a combination of issues. To make sure this doesn't happen anymore in the future, I've added some integration tests. |
Glob patterns were not properly evaluated for three reasons: 1. Quotes around globs were not preserved. As a result, unquoted wildcards were evaluated by bash instead of lychee 2. `**` patterns handled by the [glob](https://github.com/rust-lang-nursery/glob) crate need to be prefixed with a separator, e.g. `./`. See code [here](https://github.com/rust-lang-nursery/glob/blob/master/src/lib.rs#L536) and [here](https://github.com/rust-lang-nursery/glob/blob/337d417ee872dc04e8e6faff4b7379141933df59/src/lib.rs#L583-L596). We should probably switch to [globset](https://github.com/BurntSushi/globset) at some point, which doesn't have that limitation. 3. The lychee command itself needs to be executed with `eval` to make it find links. Otherwise it interprets the input argument (`${ARGS[@]}`) as a string and tries to find links within that string. (String input is supported by lychee). We want to interpret it as individual (whitespace-separated) arguments however. **Usage inside pipelines: Surround glob patterns by single (!) quotes and prefix them with `./`.** ```yaml - name: Link Checker uses: lycheeverse/[email protected] with: # Check all Markdown and HTML files args: --verbose --no-progress './**/*.md' './**/*.html' ``` Fixes #68
Merged to |
Hey @mre Thanks for your effort on this. |
Yeah the thread panic is because of seanmonstar/reqwest#1399. Not much we can do about it other than waiting or maintaining a fork of reqwest with a patch until this gets merged. 😕 I'm actually considering to create a temporary fork just for this. |
Apart from that, thanks for the feedback. 😄 |
Right on right on, looking forward to the new release for the action. |
Alright, new release is out. 😄 https://github.com/lycheeverse/lychee-action/releases/tag/v1.2.1 |
I am running Lychee as a GitHub action on https://github.com/balena-io/docs/, Lchee's GitHub action got updated v1.2.0 which lead to the pattern
**/*.md
failing.For some reason, this in the file https://github.com/balena-io/docs/blob/master/.github/workflows/link-checker.yml
translates to just finding 2 markdown files in the repository when the action is running. Refer: https://github.com/balena-io/docs/runs/4626369590?check_suite_focus=true#step:5:19
I am trying to debug if there is something on our end that changed or is it Lychee's action update that caused this. I ran Lychee locally to confirm the pattern
lychee --no-progress --config lychee.toml **/*.md
and that worked just fine. Do let me know if you need any more information to help debug this further.The text was updated successfully, but these errors were encountered: