Add automated broken link checker workflow - #23
Conversation
Co-authored-by: tuanductran <69758022+tuanductran@users.noreply.github.com>
Co-authored-by: tuanductran <69758022+tuanductran@users.noreply.github.com>
Co-authored-by: tuanductran <69758022+tuanductran@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a GitHub Actions workflow to automatically check for broken links and open labeled issues when failures are found.
Changes:
- Introduces a new
Broken Link Checkworkflow with a monthly cron schedule. - Enables manual triggering via
workflow_dispatch. - Configures
technote-space/broken-link-checker-actionwith recursive crawling and issue metadata (labels/title).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| jobs: | ||
| check: |
There was a problem hiding this comment.
For supply-chain hardening, consider pinning the third-party action to a commit SHA instead of a floating major tag (@v2). Using only a major tag allows upstream changes to affect your workflow without review.
| name: Check Broken Links | ||
| runs-on: ubuntu-latest |
There was a problem hiding this comment.
PR description/checklist says the target should be the repository’s GitHub Pages, but the workflow currently targets the GitHub repo web UI (https://github.com/${{ github.repository }}). Update TARGET to the published Pages URL (typically https://${{ github.repository_owner }}.github.io//) so the check runs against the intended site.
| schedule: | ||
| # Run monthly on the 1st at midnight UTC | ||
| - cron: '0 0 1 * *' | ||
| workflow_dispatch: # Allow manual triggering | ||
| pull_request: |
There was a problem hiding this comment.
The workflow configures issue creation via the action (LABELS/TITLE), but the job doesn’t declare token permissions. To make issue creation reliably work across repo/org settings, add an explicit permissions: block (at least issues: write, and contents: read if needed) rather than relying on the repository default GITHUB_TOKEN permissions.
|
|
||
| name: Broken Link Check | ||
|
|
There was a problem hiding this comment.
repository_dispatch isn’t mentioned in the PR description/checklist (only schedule + manual trigger). If it’s not required, consider removing it to reduce the number of ways this workflow can be triggered; otherwise, document the intended external trigger use-case.
| --- | ||
| # Note: The original broken-link-checker-action | ||
| # (technote-space/broken-link-checker-action) was archived in Nov 2022 | ||
| # and is no longer maintained. This workflow uses lychee-action, |
There was a problem hiding this comment.
This workflow starts with a YAML document marker (---) and quotes the on key ("on"). Other workflows in this repo use on: unquoted and omit --- (e.g., .github/workflows/validate-rules.yml:1-4). Consider aligning formatting for consistency.
…nfig Co-authored-by: tuanductran <69758022+tuanductran@users.noreply.github.com>
|
@copilot use lycheeverse/lychee-action@v2.7.0 and peter-evans/create-issue-from-file@v6.0.0 |
Co-authored-by: tuanductran <69758022+tuanductran@users.noreply.github.com>
Updated to lychee-action v2.7.0 and create-issue-from-file v6.0.0 (both SHA-pinned) in commit 5f73c36. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Co-authored-by: tuanductran <69758022+tuanductran@users.noreply.github.com>
Configures automated link validation for markdown files using scheduled workflow and PR checks.
Implementation
lycheeverse/lychee-action@v2.7.0(SHA-pinned). The originally requestedtechnote-space/broken-link-checker-actionwas archived in Nov 2022.peter-evans/create-issue-from-file@v6.0.0(SHA-pinned)0 0 1 * *), manual dispatch, PRs to main/develop'./**/*.md')github.event_name != 'pull_request')Configuration
Issues are automatically created with labels
buganddocumentationwhen broken links are detected.Original prompt
💡 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.