Skip to content

Conversation

mbernier
Copy link

This will allow all the links in the markdown text to be checked before a merge or commit.
It can run as a pre-commit hook locally and as a PR merge check.

This should:

  1. Run the script inside a containerized GitHub Actions environment.
  2. Checks for broken links in .md files.
  3. Fails the PR if broken links are found.

Example output:

If a link is broken in README.md:

❌ Error: Broken links found in README.md:
  - [Docs](https://example.com/invalid-page)

To set this up as a GitHub status check on PR merge:

Add a GitHub Status Check
If you want GitHub to block merging until the check passes:

  1. Go to Repository Settings → Branch Protection Rules.
  2. Add "Markdown Link Check" as a required check.

Added a yaml to manage a forthcoming markdown link checker script
Checks links on commit and PR merge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant