/markdown-links-action

Markdown Link Checker, automates the process of validating links in Markdown files within a GitHub repository. It ensures that all hyperlinks in your documentation are functional and up-to-date, helping maintain the integrity and reliability of your project's documentation.

Primary LanguageTypeScriptMIT LicenseMIT

Stand With Ukraine


Markdown Links Action Logo
Markdown Links Action

A GitHub Action for validating links in Markdown files.

OverviewFeaturesConfigurationUsage ExamplesContributingLicense


📋 Overview

The Markdown Links Action automates the process of validating links in Markdown files within a GitHub repository, ensuring all hyperlinks in your documentation are functional and up-to-date.

✨ Features

  • Link Validation: Checks hyperlinks in Markdown files for validity.
  • Customizable Folder Paths: Specify directories to check for Markdown files.
  • PR Specific Checks: Option to check only modified files in pull requests.
  • Issue Creation: Ability to create GitHub issues for broken links.
  • Flexible Configuration: Configure various aspects of the action according to your project's needs.

⚙️ Configuration

Configure the action using these inputs:

Input Description Required Default Value
folder-path Custom folder path for Markdown files. Yes .
max-depth Maximum depth for directory checks. Yes -1
check-modified-files-only Check only modified files if set to yes. Yes no
base-branch Base branch for comparing changes in PRs. Yes main
file-extension File extension of Markdown files to check. Yes .md
file-path Additional specific files to check. Yes
create-issue Create issue for broken links if set to yes. Yes no
gh-assignees Assignees for the created issues. No
gh-labels Labels for the created issues. No
repo-token GitHub token for authentication. Yes
repository GitHub repository in the format owner/repo. Yes

⚡ Usage Examples

Basic Usage

Check links in all Markdown files in the repository:

on: [push, pull_request]
name: Markdown Link Check
jobs:
  linkCheck:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: your_username/markdown-links-action@v1

Custom Folder Path

Check links only in the docs directory:

on: [push, pull_request]
name: Check Docs Links
jobs:
  linkCheck:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: your_username/markdown-links-action@v1
        with:
          folder-path: 'docs'

PR Specific Checks

Check only modified files in a pull request:

on: [pull_request]
name: Check Modified Markdown Links
jobs:
  linkCheck:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: your_username/markdown-links-action@v1
        with:
          check-modified-files-only: 'yes'

❤️ Contributing

Interested in contributing? We welcome all contributions, big or small. Check out our Contribution Guide for details.

📝 License

Distributed under the MIT License. See LICENSE for more information.



Made with 🤙 by Roman Dutchak