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

link-checker: exclude private URLs like localhost #306

Merged
merged 1 commit into from
Nov 8, 2023

Conversation

egpbos
Copy link
Member

@egpbos egpbos commented Nov 3, 2023

Below, describe what this Pull Request adds:

One of the links that failed the link-checker are a localhost reference. Links like that should never be checked and lychee has an option for that. This PR adds that option.

@egpbos egpbos mentioned this pull request Nov 3, 2023
@egpbos
Copy link
Member Author

egpbos commented Nov 3, 2023

Oh weird, lychee.toml also includes this option already. Is lychee.toml actually used by the GH Action?

@bouweandela
Copy link
Member

I had a look at the github action code and I think it should do that.

@egpbos
Copy link
Member Author

egpbos commented Nov 6, 2023

Perhaps it doesn't recognize localhost:4000 as a private address then? That's the one that's tripping the link checker currently.

@bouweandela
Copy link
Member

Would it make sense to enable the link-checker.yml action on the branch of this pull request to see if it actually solves the issue?

@egpbos egpbos force-pushed the link-checker_exclude-private branch 3 times, most recently from 1a1e74a to 376cbb5 Compare November 6, 2023 15:54
@egpbos
Copy link
Member Author

egpbos commented Nov 6, 2023

Can't seem to get it to work on CI...

I've also tried some localhost things on my laptop, with different ports, https/http, etc., but lychee always seems to fail on localhost, even if the Guide is hosted on localhost, kinda weird. However, --exclude-all-private does work, also with the localhost:4000 address, so it should work on CI too.

@egpbos
Copy link
Member Author

egpbos commented Nov 6, 2023

Oh, I think the issue is that the lychee action has a default value for the args parameter: --verbose --no-progress './**/*.md' './**/*.html'. If you don't add that stuff, especially the latter two patterns or something similar, the whole action doesn't run.

@egpbos egpbos force-pushed the link-checker_exclude-private branch from 376cbb5 to 6bc1dc0 Compare November 6, 2023 18:02
@egpbos
Copy link
Member Author

egpbos commented Nov 6, 2023

Force push with another fix to the check...

@egpbos
Copy link
Member Author

egpbos commented Nov 7, 2023

Ok, so apparently the config file is not read, because adding --exclude-all-private does work. I'll now try with an explicit -c lychee.toml...

@egpbos egpbos force-pushed the link-checker_exclude-private branch from 6bc1dc0 to fb49026 Compare November 7, 2023 07:59
@egpbos
Copy link
Member Author

egpbos commented Nov 7, 2023

Aha, Error: Error while loading config file "lychee.toml": Failed to parse configuration file...

@egpbos
Copy link
Member Author

egpbos commented Nov 7, 2023

Fixed! The problem was that the lychee.toml syntax was changed, I think, since we added the file. Anyway, it works now, I will make a new commit...

@egpbos egpbos force-pushed the link-checker_exclude-private branch from 4051326 to 053a0c8 Compare November 7, 2023 08:57
@egpbos
Copy link
Member Author

egpbos commented Nov 7, 2023

Removed the unnecessary commits, now only the lychee.toml fix remains (which was effectively already the case after the 4051326 commit, which undid all the others).

@egpbos
Copy link
Member Author

egpbos commented Nov 7, 2023

Please review @bouweandela

Copy link
Member

@bouweandela bouweandela left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@bouweandela bouweandela merged commit 0d1d86c into main Nov 8, 2023
1 check passed
@bouweandela bouweandela deleted the link-checker_exclude-private branch November 8, 2023 14:37
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

Successfully merging this pull request may close these issues.

2 participants