Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
external-link

GitHub Action

Markdown dead link checker

0.2

Markdown dead link checker

external-link

Markdown dead link checker

This handy tool helps you maintain the integrity of your Markdown files by identifying broken links

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Markdown dead link checker

uses: AlexanderDokuchaev/md-dead-link-check@0.2

Learn more about this action in AlexanderDokuchaev/md-dead-link-check

Choose a version

Markdown dead link checker

This is a lightweight and fast tool to help you keep your Markdown files free of broken links! It scans your Markdown files and verifies whether each link is still active, letting you know if any need attention.

Detection issues

  • Unavailable web links.
  • Incorrect links to file.
  • Not existed fragments in markdown, like [no-fragment](README.md#no-fragment).

Example of output for fail.md

File: tests/test_md_files/fail.md:3 • Link: https://github.com/AlexanderDokuchaev/FAILED • Error: 404: Not Found
File: tests/test_md_files/fail.md:4 • Link: https://not_exist_github.githubcom/ • Error: 500: Internal Server Error
File: tests/test_md_files/fail.md:8 • Link: /test/fail.md1 • Error: Path does not exist
File: tests/test_md_files/fail.md:9 • Link: fail.md1 • Error: Path does not exist
File: tests/test_md_files/fail.md:13 • Link: a.md#fail • Error: Not found fragment
❌ Found 5 dead links 🙀

Usage

Github action

jobs:
  md-dead-link-check:
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v4
      - uses: AlexanderDokuchaev/md-dead-link-check@main

Pre-commit hook

Adding to your .pre-commit-config.yaml

  - repo: https://github.com/AlexanderDokuchaev/md-dead-link-check
    rev: main
    hooks:
      - id: md-dead-link-check

Install rom pip

pip install md-dead-link-check
md-dead-link-check

Install github repo

git clone https://github.com/AlexanderDokuchaev/md-dead-link-check
cd md-dead-link-check
pip install .
md-dead-link-check

Configuration

By default use pyproject.toml, to use another config toml file use --config.

  • timeout - timeout to response web link, defaults 10.
  • exclude_links - disable fails for links, defaults [].
  • exclude_files - disable check for file, defaults [].
  • check_web_links - to disable check web links, defaults true.
[tool.md_dead_link_check]
timeout = 10
exclude_links = ["https://github.com/"]
exclude_files = ["tests/test_md_files/fail.md"]
check_web_links = true