Skip to content

Conversation

Copy link

Copilot AI commented Oct 27, 2025

Adds automated link validation to prevent broken or incomplete links from being committed.

Changes

  • New workflow .github/workflows/check-links.yml runs on pushes and PRs to main
  • Uses lychee-action - Industry-standard link checker that validates all links in HTML and Markdown files
  • Detects multiple issues including empty links, broken links, invalid URLs, and unreachable resources
  • Comprehensive validation for href="", href='', [text](), [](), and broken external links
  • Minimal permissions contents: read only

The workflow uses lycheeverse/lychee-action@v1, a widely-adopted, actively-maintained link checker that provides:

  • Fast and efficient link validation
  • Detailed error reporting with file locations
  • Support for multiple file formats (HTML, Markdown, etc.)
  • Automatic handling of edge cases
  • Exclusion of email addresses from validation

Example Output

The action provides clear output showing broken or empty links with their locations:

❌ [404] https://example.com/broken-link | ./content/post.md:15
❌ [Empty] href="" | ./layouts/example.html:42
Original prompt

Add a workflow to check empty links at every commit


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Oct 27, 2025

Deploying bouncmpe with  Cloudflare Pages  Cloudflare Pages

Latest commit: 0513336
Status:🚫  Build failed.

View logs

Copilot AI changed the title [WIP] Add workflow to check empty links at every commit Add GitHub Actions workflow to check for empty links Oct 27, 2025
Copilot AI requested a review from doganulus October 27, 2025 13:19
Copilot finished work on behalf of doganulus October 27, 2025 13:20
@doganulus
Copy link
Member

@copilot Use an existing empty link checker or action instead of hard coding over raw html.

Copy link
Author

Copilot AI commented Oct 27, 2025

@copilot Use an existing empty link checker or action instead of hard coding over raw html.

Replaced the custom grep-based implementation with lycheeverse/lychee-action@v1, which is a widely-used, actively-maintained link checker that handles HTML, Markdown, and comprehensive link validation. (0513336)

Copilot AI changed the title Add GitHub Actions workflow to check for empty links Add GitHub Actions workflow to check for empty and broken links Oct 27, 2025
Copilot finished work on behalf of doganulus October 27, 2025 14:08
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.

2 participants