-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Check links relevant to the changes in a PR only #238
Comments
Interesting. I think we could add that to our documentation at https://github.com/lycheeverse/lycheeverse.github.io It could be next to this recipe in the documentation hierarchy: Would you like to create a pull request? Otherwise I can also take care of it. |
That's weird. When I remove the |
Could this be implemented in the action or lychee itself? |
I guess it could be. Question is if we should. It would be a maintenance burden. Is copy-pasting the GitHub workflow an issue? |
@mre I still want to implement checking internal links affected by removed files as mentioned above. Once I finish, I will create a pull request to add this information to the docs as you suggested. It might take a couple of weeks though, since I am a bit busy recently. |
Cool. Thanks a lot! |
@f-hollow, any updates? Would love to have this. |
Thank you very much for waiting. This workflow has been running in my repo all this time and there are two instances of strange behavior which I would like to inspect. Just noticed that a PR has already been created. Thank you @sekyondaMeta! In this case, I will see if any improvements are needed :) |
I guess that's a misunderstanding. The referenced pull request targets Please double-check if I made a mistake and feel free to update the docs over there. |
While I appreciate the added docs, from a user perspective that's quite a complex setup to copy. Compare that to something like this |
Naturally, it is desirable to minimize bothering your contributor with issues introduced by somebody else in your repo. So I need a way to check and report invalid links (1) added / updated in that contributor's PR only, or (2) existing links affected by the introduced changes.
It appeared to be harder than I expected. You cannot run lychee on the changes only, because the links internal to your repo (checked with my beloved
--include-fragments
option) can and will produce false positives.Browsing around this repo, I came across mre's comment about separately checking existing links and new links. This idea nudged me in the right direction! The related issues #17 and #134 offer no immediately usable solution yet.
Below is the workflow that I created and tested so far. It works and does what I need.
Possible improvements:
git stash
, otherwise GitHub CI complains about the untracked filelinks-main.txt
(not sure why it works like this):git stash
)?.lycheeignore
still contains them. My repo has a cron job checking all links in main once a week, which should take care of such issues for the time being.Action: In this workflow, it might be good to recheck existing internal links affected by removed files.
Action: Any other ways to further optimize this workflow or make it more robust?
Your feedback or further improvements to this workflow would be very much appreciated!
The workflow that checks links relevant to the changes in a PR only
The text was updated successfully, but these errors were encountered: