All Projects β†’ gaurav-nelson β†’ Github Action Markdown Link Check

gaurav-nelson / Github Action Markdown Link Check

Licence: mit
Check all links in markdown files if they are alive or dead. πŸ”—βœ”οΈ

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to Github Action Markdown Link Check

Homebrewery
Create authentic looking D&D homebrews using only markdown
Stars: ✭ 598 (+353.03%)
Mutual labels:  hacktoberfest, markdown
Glow
Render markdown on the CLI, with pizzazz! πŸ’…πŸ»
Stars: ✭ 7,596 (+5654.55%)
Mutual labels:  hacktoberfest, markdown
Hacktoberfest
Participate in Hacktoberfest by contributing to any Open Source project on GitHub! Here is a starter project for first time contributors. #hacktoberfest
Stars: ✭ 631 (+378.03%)
Mutual labels:  hacktoberfest, markdown
Rigel
🌌 Colorscheme for vim, terminal, vscode and slack - based on the star Rigel ✨.
Stars: ✭ 324 (+145.45%)
Mutual labels:  hacktoberfest, markdown
Github Action Get Previous Tag
Get the previous tag
Stars: ✭ 42 (-68.18%)
Mutual labels:  hacktoberfest, action
Github Profile Readme Generator
πŸš€ Generate GitHub profile README easily with the latest add-ons like visitors count, GitHub stats, etc using minimal UI.
Stars: ✭ 7,812 (+5818.18%)
Mutual labels:  hacktoberfest, markdown
Rich
Rich is a Python library for rich text and beautiful formatting in the terminal.
Stars: ✭ 31,664 (+23887.88%)
Mutual labels:  hacktoberfest, markdown
Verless
A simple and lightweight Static Site Generator.
Stars: ✭ 276 (+109.09%)
Mutual labels:  hacktoberfest, markdown
Markdown
A super fast, highly extensible markdown parser for PHP
Stars: ✭ 945 (+615.91%)
Mutual labels:  hacktoberfest, markdown
Markitdown
πŸ“± A React app to preview and edit Markdown✍. You can also export it as HTML.
Stars: ✭ 26 (-80.3%)
Mutual labels:  hacktoberfest, markdown
Noteless
A Markdown-based note-taking app for mobile devices.
Stars: ✭ 302 (+128.79%)
Mutual labels:  hacktoberfest, markdown
Markor
Text editor - Notes & ToDo (for Android) - Markdown, todo.txt, plaintext, math, ..
Stars: ✭ 1,394 (+956.06%)
Mutual labels:  hacktoberfest, markdown
Termimad
A library to display rich (Markdown) snippets and texts in a rust terminal application
Stars: ✭ 293 (+121.97%)
Mutual labels:  hacktoberfest, markdown
Mathdown
Collaborative markdown with math
Stars: ✭ 410 (+210.61%)
Mutual labels:  hacktoberfest, markdown
Text
πŸ“‘ Collaborative document editing using Markdown
Stars: ✭ 282 (+113.64%)
Mutual labels:  hacktoberfest, markdown
Backslide
πŸ’¦ CLI tool for making HTML presentations with Remark.js using Markdown
Stars: ✭ 679 (+414.39%)
Mutual labels:  hacktoberfest, markdown
Github Profilinator
πŸš€ This tool contains mini GUI components that you can hook together to automatically generate markdown code for a perfect readme.
Stars: ✭ 225 (+70.45%)
Mutual labels:  hacktoberfest, markdown
Transcripts
Changelog episode transcripts in Markdown format πŸ“š
Stars: ✭ 260 (+96.97%)
Mutual labels:  hacktoberfest, markdown
Github Changelog Generator
Automatically generate change log from your tags, issues, labels and pull requests on GitHub.
Stars: ✭ 6,631 (+4923.48%)
Mutual labels:  hacktoberfest, markdown
Settingsguide
More extensive explanations of Cura slicing settings.
Stars: ✭ 55 (-58.33%)
Mutual labels:  hacktoberfest, markdown

GitHub Action - Markdown link check πŸ”—βœ”οΈ

GitHub Marketplace

This GitHub action checks all Markdown files in your repository for broken links. (Uses tcort/markdown-link-check)

How to use

  1. Create a new file in your repository .github/workflows/action.yml.

  2. Copy-paste the following workflow in your action.yml file:

    name: Check Markdown links
    
    on: push
    
    jobs:
      markdown-link-check:
        runs-on: ubuntu-latest
        steps:
        - uses: actions/[email protected]
        - uses: gaurav-nelson/[email protected]
    

Real-life usage samples

Following is a list of some of the repositories which are using GitHub Action - Markdown link check.

  1. netdata
  2. GoogleChrome/lighthouse
  3. hashicorp/packer
  4. prometheus-operator
  5. apache/apisix

If you are using this on production, consider buying me a coffee β˜•.

Configuration

Custom variables

You customize the action by using the following variables:

Variable Description Default value
use-quiet-mode Specify yes to only show errors in output. no
use-verbose-mode Specify yes to show detailed HTTP status for checked links. no
config-file Specify a custom configuration file for markdown-link-check. You can use it to remove false-positives by specifying replacement patterns and ignore patterns. mlc_config.json
folder-path By default the github-action-markdown-link-check action checks for all markdown files in your repository. Use this option to limit checks to only specific folders. Use comma separated values for checking multiple folders. .
max-depth Specify how many levels deep you want to check in the directory structure. The default value is -1 which means check all levels. -1
check-modified-files-only Use this variable to only check modified markdown files instead of checking all markdown files. The action uses git to find modified markdown files. Only use this variable when you run the action to check pull requests. no
base-branch Use this variable to specify the branch to compare when finding modified markdown files. master
file-extension By default the github-action-markdown-link-check action checks files in your repository with the .md extension. Use this option to specify a different file extension such as .markdown or .mdx. .md
file-path Specify additional files (with complete path and extension) you want to check. Use comma separated values for checking multiple files. See Check multiple directories and files section for usage. -

Sample workflow with variables

name: Check Markdown links

on: push

jobs:
  markdown-link-check:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/[email protected]
    - uses: gaurav-nelson/[email protected]
      with:
        use-quiet-mode: 'yes'
        use-verbose-mode: 'yes'
        config-file: 'mlc_config.json'
        folder-path: 'docs/markdown_files'
        max-depth: 2

Scheduled runs

In addition to checking links on every push, or pull requests, its also a good hygine to check for broken links regularly as well. See Workflow syntax for GitHub Actions - on.schedule for more details.

Sample workflow with scheduled job

name: Check Markdown links

on: 
  push:
    branches:
    - master
  schedule:
  # Run everyday at 9:00 AM (See https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07)
  - cron: "0 9 * * *"

jobs:
  markdown-link-check:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/[email protected]
    - uses: gaurav-nelson/[email protected]
      with:
        use-quiet-mode: 'yes'
        use-verbose-mode: 'yes'
        config-file: 'mlc_config.json'
        folder-path: 'docs/markdown_files'

Disable check for some links

You can include the following HTML comments into your markdown files to disable checking for certain links in a markdown document.

  1. <!-- markdown-link-check-disable --> and <!-- markdown-link-check-enable-->: Use these to disable links for all links appearing between these comments.
    • Example:
      <!-- markdown-link-check-disable -->
      ## Section
      
      Disbale link checking in this section. Ignore this [Bad Link](https://exampleexample.cox)
      <!-- markdown-link-check-enable -->
      
  2. <!-- markdown-link-check-disable-next-line --> Use this comment to disable link checking for the next line.
  3. <!-- markdown-link-check-disable-line --> Use this comment to disable link checking for the current line.

Check only modified files in a pull request

Use the following workflow to only check links in modified markdown files in a pull request.

When you use this variable, the action finds modififed files between two commits:

  • latest commit in you PR
  • latest commit in the master branch. If you are suing a different branch to merge PRs, specify the branch using base-branch.

NOTE: We can also use GitHub API to get all modified files in a PR, but that would require tokens and stuff, create an issue or PR if you need that.

on: [pull_request]
name: Check links for modified files
jobs:
  markdown-link-check:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/[email protected]
    - uses: gaurav-nelson/[email protected]
      with:
        use-quiet-mode: 'yes'
        use-verbose-mode: 'yes'
        check-modified-files-only: 'yes'

Check multiple directories and files

on: [pull_request]
name: Check links for modified files
jobs:
  markdown-link-check:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/[email protected]
    - uses: gaurav-nelson/[email protected]
      with:
        use-quiet-mode: 'yes'
        folder-path: 'md/dir1, md/dir2'
        file-path: './README.md, ./LICENSE, ./md/file4.markdown'

Too many requests

Use retryOn429, retry-after, retryCount, and fallbackRetryDelay in your custom configuration file. See https://github.com/tcort/markdown-link-check#config-file-format for details.

Or mark 429 status code as alive:

{
  "aliveStatusCodes": [429, 200]
}

Versioning

GitHub Action - Markdown link check follows the GitHub recommended versioning strategy.

  1. To use a specific released version of the action (Releases):
    - uses: gaurav-nelson/[email protected]
    
  2. To use a major version of the action:
    - uses: gaurav-nelson/[email protected]
    
  3. You can also specify a specific commit SHA as an action version:
    - uses: gaurav-nelson/[email protected]fb79f1f478
    

Buy me a coffee.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].