nix-homelab icon indicating copy to clipboard operation
nix-homelab copied to clipboard

Add automated dead link checker for README.md

Open badele opened this issue 1 month ago • 0 comments

Description

Add a GitHub Actions workflow to automatically check for broken/dead links in the README.md file on a daily basis.

Motivation

As the project documentation evolves, external links may become outdated or broken. An automated daily check would help maintain documentation quality by detecting dead links early.

Proposed Solution

Create a new GitHub Actions workflow .github/workflows/check-links.yml that:

  1. Runs daily via cron schedule (e.g., every day at 00:00 UTC)
  2. Runs on push to Pull request or main branch when README.md is modified
  3. Checks all links in README.md for HTTP status codes
  4. Reports failures by creating an issue or sending a notification

Suggested Implementation

Use this proven link checker action https://github.com/lycheeverse/lychee-action - Fast, async link checker written in Rust

Example Workflow Skeleton

name: Check Links

on: schedule: - cron: '0 0 * * *' # Daily at midnight UTC push: branches: [main] paths: - 'README.md' workflow_dispatch: # Allow manual trigger

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

    - name: Check links in README.md
      uses: lycheeverse/lychee-action@v2
      with:
        args: --verbose --no-progress './README.md'
        fail: true

    - name: Create Issue on failure
      if: failure()
      uses: actions/github-script@v7
      with:
        script: |
          github.rest.issues.create({
            owner: context.repo.owner,
            repo: context.repo.repo,
            title: 'Dead links detected in README.md',
            body: 'The automated link checker found broken links. Please review the workflow logs.',
            labels: ['documentation', 'bug']
          })

Acceptance Criteria

  • Workflow file created in .github/workflows/
  • Scheduled to run daily
  • Also runs on README.md changes
  • Detects and reports broken links
  • Creates an issue or notification on failure
  • Can be manually triggered via workflow_dispatch

Additional Notes

  • Consider adding a .lycheeignore file to exclude known false-positives (e.g., localhost URLs, authentication-required links)
  • May want to check other markdown files beyond README.md in the future

badele avatar Oct 30 '25 18:10 badele