Skip to content

Linkcheck: transition to QuantEcon/action-link-checker #30

Description

@mmcky

PR #26 added a bespoke linkcheck.yml that wires together three moving parts by hand — wget-mirroring the live site, lycheeverse/lychee-action, and peter-evans/create-issue-from-file. This issue tracks replacing that with QuantEcon's purpose-built composite action, QuantEcon/action-link-checker, so lecture-dp matches the rest of the lecture family (lecture-python-programming already runs it).

Why switch

Current (linkcheck.yml from #26) With action-link-checker
Three stitched-together steps to maintain One maintained org action
lychee over **/*.html flags local _static/*, JS and image refs as broken (the mirror only pulls .html) Scans external web links only — no local-asset false positives
create-issue-from-file + hand-set labels Native create-issue + notify (auto-assigns maintainers)
Weekly schedule only Also supports mode: changed for PR-level checks later

Open decision — where the HTML comes from

The action takes an html-path directory (default ./_build/html). lecture-dp has no gh-pages branch (it deploys via the OIDC artifact workflow), which is exactly why #26 reached for wget-mirroring — so the transition still has to answer this. The cleanest option is to build in-workflow behind the existing Jupyter cache (a warm-cache build skips execution and runs fast) and point the action at the build output; the lower-cost alternative is to keep wget-mirroring the live site into a directory and pass that as html-path.

Sketch (build-in-workflow variant)

Pin to a release tag — only v1.0.0 exists today, there is no sliding v1 (lecture-python-programming pins @main). With Dependabot now configured, a tag pin will be kept current automatically.

name: Link Checker
on:
  schedule:
    - cron: '0 23 * * 0'   # Sunday 23:00 UTC
  workflow_dispatch:

jobs:
  link-check:
    runs-on: ubuntu-latest
    container:
      image: ghcr.io/quantecon/quantecon-build:latest
    permissions:
      contents: read
      issues: write
    steps:
      - uses: actions/checkout@v6
        with:
          fetch-depth: 0
      - uses: quantecon/actions/restore-jupyter-cache@v0.6.0
      - uses: quantecon/actions/build-lectures@v0.6.0
        id: build
        with:
          builder: html
      - uses: QuantEcon/action-link-checker@v1.0.0
        with:
          html-path: ${{ steps.build.outputs.build-path }}
          mode: full
          fail-on-broken: 'false'
          create-issue: 'true'
          silent-codes: '403,503'
          issue-title: 'Weekly Link Check Report'
          notify: 'mmcky'

Acceptance criteria

  • Decide the HTML source (in-workflow build vs. wget-mirror)
  • Replace linkcheck.yml with action-link-checker, pinned to a release tag
  • Smoke-test via workflow_dispatch: confirm a clean run, and that a seeded broken link produces an assigned issue
  • Remove the now-unused lychee / create-issue-from-file wiring

Part of #22; supersedes the interim linkcheck.yml introduced in #26.

Metadata

Metadata

Assignees

No one assigned

    Labels

    maintenanceMaintenance tasks on the repository

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions