Files
Copilot 953b108158 [WIP] Fix broken links on excelmcpserver.dev (#877)
* Initial plan

* Fix lychee --root-dir arg and repair broken outbound links in docs

Co-authored-by: sbroenne <3026464+sbroenne@users.noreply.github.com>

* Add changeset for the Power BI Desktop and registry link fixes

Co-authored-by: sbroenne <3026464+sbroenne@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: sbroenne <3026464+sbroenne@users.noreply.github.com>
2026-09-16 07:53:40 +09:00

78 lines
2.5 KiB
YAML

name: Link Check
# Weekly link rot check for the published site.
#
# audit_site.py already validates internal structure on every PR, but nothing
# checked that the site's outbound links still resolve. Broken external links
# degrade both the reading experience and search ranking.
#
# Deliberately NOT run on pull requests: external endpoints rate-limit and go
# down for reasons unrelated to the change under review, so this would be a
# flaky required check. It runs on a schedule and files an issue instead.
on:
schedule:
- cron: "23 5 * * 1"
workflow_dispatch:
permissions:
contents: read
jobs:
link-check:
name: Check links in built site
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
steps:
- name: Checkout
uses: actions/checkout@v7
with:
# hooks.py derives sitemap dates from git history. A shallow checkout
# makes the strict MkDocs build fail before the link check can run.
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v7
with:
python-version: '3.13'
cache: pip
cache-dependency-path: gh-pages/requirements.txt
- name: Install dependencies
run: pip install -r gh-pages/requirements.txt
- name: Build site
working-directory: gh-pages
run: mkdocs build --strict --clean
- name: Check links
id: lychee
uses: lycheeverse/lychee-action@v2
with:
# --root-dir lets root-relative hrefs resolve against the built
# output, so internal and external links are both covered. It must be
# an absolute path - lychee rejects relative values.
args: >-
--root-dir ${{ github.workspace }}/gh-pages/_site
--no-progress
--max-concurrency 4
--accept 200,206,429
--exclude '^https?://localhost'
--exclude '^https?://127\.0\.0\.1'
--exclude 'example\.com'
'gh-pages/_site/**/*.html'
fail: true
output: lychee-report.md
- name: File an issue when links are broken
if: failure() && steps.lychee.outcome == 'failure'
uses: peter-evans/create-issue-from-file@v6
with:
title: "Broken links on excelmcpserver.dev"
content-filepath: lychee-report.md
# Only labels that actually exist in this repo - the API rejects
# unknown label names.
labels: documentation