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

Broken Link Checker - Github Action #354

Open
JuanPabloDiaz opened this issue May 9, 2024 · 2 comments
Open

Broken Link Checker - Github Action #354

JuanPabloDiaz opened this issue May 9, 2024 · 2 comments

Comments

@JuanPabloDiaz
Copy link
Contributor

I believe that it will be a great idea to setup a GitHub action that runs periodically and checks for broken links.
It will check all repository links once per day and create an issue in case of errors.

Github action to check for broken links in Markdown, HTML, and text files using Lychee, a fast link checker written in Rust.

Here is a full example of a GitHub workflow file:

It will check all repository links once per day and create an issue in case of errors.

name: Links

on:
  repository_dispatch:
  workflow_dispatch:
  schedule:
    - cron: "00 18 * * *"

jobs:
  linkChecker:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Link Checker
        id: lychee
        uses: lycheeverse/lychee-action@v1

      - name: Create Issue From File
        if: env.lychee_exit_code != 0
        uses: peter-evans/create-issue-from-file@v4
        with:
          title: Link Checker Report
          content-filepath: ./lychee/out.md
          labels: report, automated issue

I'd like to share my experience with Lychee. I came across it yesterday and integrated it into my project. While it was helpful in identifying some broken links, it also generated some false positives (links that appear broken but function correctly). I'm still exploring the tool's functionality to potentially fine-tune its accuracy.

On a separate note, I encountered a permissions issue when trying to open new issues.

Project implementations:

here is an example from my own project:
image

I hope this helps

@JuanPabloDiaz
Copy link
Contributor Author

My bad, I believe you are already using a github action that does just that. Could you please confirm if validate_links.yml check for broken links?

@marcelscruz
Copy link
Owner

The file you linked came from the original fork, and as we changed a few things around here, I'm not sure if it's working.
If you have a good understanding of Python (which I don't), it'd be great if you could have a look at it and see if it's still working! 🙏
Btw, you summary screenshot looks great, would love like that around here!

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

2 participants