feat: add link-check CI workflow to prevent broken links - #8074
Conversation
…-based link checker for external URLs - Add relative link validation script - Runs on push/PR to main and weekly schedule - Enforces relative links, non-blocking for external links Closes Scottcjn#7910, Scottcjn#7908, Scottcjn#7886, Scottcjn#7885, Scottcjn#7792
|
Welcome to RustChain! Thanks for your first pull request. Before we review, please make sure:
Bounty tiers: Micro (1-10 RTC) | Standard (20-50) | Major (75-100) | Critical (100-150) A maintainer will review your PR soon. Thanks for contributing! |
|
Done. Added SPDX license header to check_links.py. This is a doc-only PR (CI workflow + link checker script), so BCOS tier labels are not required per the policy. |
…iginal find ... | while read pipe created a subshell, so 'exit 1' inside the inner loop only exited the subshell — the CI job always passed regardless of broken links. Fix: use process substitution (<()) with -print0 to avoid pipes. ERRORS counter is now checked after the loop; a non-zero count triggers 'exit 1' in the main script shell, properly failing the job.
|
I ran the relative-link step from this workflow against the repo as it stands. It reports 424 broken links, and the ones I spot-checked all exist. Since that step ends in The checker has three bugs that account for the false positives: 1. Paths are resolved from the repo root, not from the file containing the link. 2. Anchors are not stripped. 3. Directory links with a trailing slash. Sample output, with the targets confirmed present in the tree: Two other things: The external lychee step has both The repo already has My recommendation is to close this in favour of the existing |
Summary This PR adds a link-check CI workflow to prevent broken links in documentation. ## Changes - Added `.github/workflows/link-check.yml` with: - Relative link validation: Checks all markdown files for broken relative links (must pass) - External link checking: Uses lychee to check external URLs (non-blocking for transient failures) - Runs on push/PR to main and weekly schedule ## Closes - Closes #7910 - Closes #7908 - Closes #7886 - Closes #7885 - Closes #7792 ## Bounty Bounty: Scottcjn/rustchain-bounties#16248 ## RTC Wallet RTC wallet address will be provided upon merge.