Skip to content

academic/link-checker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Markdown Link Checker Action

Reusable GitHub Action (Bash-only checker) for Markdown links.

It reports and optionally fails on:

  • 404
  • redirect_to_404 (initial response is 3xx, final resolved response is 404)
  • 402 and 403
  • any 5xx

The action generates a Markdown table report with:

  • file path
  • line number
  • original URL
  • final URL after redirects
  • HTTP status
  • issue type

Usage In Another Repository

name: Markdown Link Check

on:
  schedule:
    # Every Monday at 08:00 UTC
    - cron: '0 8 * * 1'
  pull_request:
    paths:
      - '**/*.md'
      - '**/*.markdown'
  push:
    paths:
      - '**/*.md'
      - '**/*.markdown'
  workflow_dispatch:

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

      - name: Run markdown link checker action
        id: link_check
        uses: academic/link-checker@v1
        with:
          report-file: link-check-results.md
          fail-on-issue: "true"

      - name: Upload report artifact
        if: always()
        uses: actions/upload-artifact@v4
        with:
          name: markdown-link-check-report
          path: ${{ steps.link_check.outputs.report-file }}

Inputs

  • report-file: output report path. Default: link-check-results.md
  • fail-on-issue: whether to fail the job when issues are found. Default: "true"
  • user-agent: User-Agent for HTTP requests. Default: markdown-link-check-github-action

Outputs

  • checked-count: number of links checked
  • issue-count: number of matching issues found
  • report-file: generated report path

Notes

  • This repository should be tagged (for example v1) before external usage.
  • Example tagging commands:
git tag -a v1 -m "Release v1"
git push origin v1

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages