From 330a1659a80148191119e6a088d634587d4ca773 Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Thu, 4 Jun 2026 20:47:58 +0000 Subject: [PATCH 1/3] Add lychee link checker config and CI workflow Adds a lychee configuration and a Links GitHub Actions workflow so that stale or redirecting links are caught automatically going forward. The checker runs on push, pull request, and weekly to catch external link rot. max_redirects is 0 so links that have moved are surfaced and can be updated to their canonical destination. lychee is installed via mise (pinned to 0.23.0 in mise.toml/mise.lock) and run via the check-links task, both locally and in CI. Part of STF-557. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/links.yml | 32 +++++++++++++++++++++ .gitignore | 1 + lychee.toml | 57 +++++++++++++++++++++++++++++++++++++ mise.lock | 28 ++++++++++++++++++ mise.toml | 5 ++++ 5 files changed, 123 insertions(+) create mode 100644 .github/workflows/links.yml create mode 100644 lychee.toml diff --git a/.github/workflows/links.yml b/.github/workflows/links.yml new file mode 100644 index 0000000..5e3255b --- /dev/null +++ b/.github/workflows/links.yml @@ -0,0 +1,32 @@ +name: Links + +on: + push: + pull_request: + schedule: + - cron: "0 13 * * 1" # weekly, to catch external link rot without a commit + workflow_dispatch: + +permissions: + contents: read + +jobs: + linkChecker: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - name: Setup mise + uses: jdx/mise-action@6d1e696aa24c1aa1bcc1adea0212707c71ab78a8 # v3.6.1 + with: + install: false + + # Install only lychee (not the repo's full toolchain) and run the check. + - name: Check links + env: + MISE_AUTO_INSTALL: "false" + run: | + mise install lychee + mise run check-links diff --git a/.gitignore b/.gitignore index eee7f99..0a9fe2e 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /cmd/calculate-contributions/calculate-contributions +.lycheecache diff --git a/lychee.toml b/lychee.toml new file mode 100644 index 0000000..49ae30a --- /dev/null +++ b/lychee.toml @@ -0,0 +1,57 @@ +# Lychee link checker configuration +# https://lychee.cli.rs/#/usage/config +# +# Run locally with: +# lychee './**/*.md' './**/*.go' + +# Include URL fragments in checks +include_fragments = true + +# Don't allow any redirects, so links that have moved are surfaced and can be +# updated to their canonical destination. +max_redirects = 0 + +# Accept these HTTP status codes +# 100-103: Informational responses +# 200-299: Success responses +# 403: Forbidden (some sites use this for rate limiting) +# 429: Too Many Requests +# 500-599: Server errors (temporary issues shouldn't fail CI) +# 999: LinkedIn's custom status code +accept = ["100..=103", "200..=299", "403", "429", "500..=599", "999"] + +# Exclude URL patterns from checking (treated as regular expressions) +exclude = [ + # GitHub blob URLs with line-number fragments (not parseable as page anchors) + '^https://github\.com/[^/]+/[^/]+/blob/[0-9a-fA-F]+/.+#L\d+$', + # Live / auth-gated MaxMind endpoints: appear as code string literals or + # require login, so they can't be verified by an anonymous request. + '^https://geoip\.maxmind\.com', + '^https://geolite\.info', + '^https://minfraud\.maxmind\.com', + '^https://sandbox\.maxmind\.com', + '^https://updates\.maxmind\.com', + '^https://www\.maxmind\.com/en/accounts/', + '^https://www\.maxmind\.com/en/account/login', + # Local / placeholder URLs (e.g. proxy or host examples in docs/code) + '^file://', + '^https?://example\.(com|org|net)', + '^http://localhost', + '127\.0\.0\.1', +] + +# Exclude file paths from getting checked (regular expressions, matched against +# the path relative to the working directory). Patterns are segment-anchored +# with (^|/) so short names like "build" don't match unintended paths. +exclude_path = [ + '(^|/)vendor/', + # Changelog: historical entries are preserved as-is, not rewritten + '(^|/)CHANGELOG\.md$', +] + +# Cache results for 1 day to speed up repeated checks +cache = true +max_cache_age = "1d" + +# Skip missing input files instead of erroring +skip_missing = true diff --git a/mise.lock b/mise.lock index 0fccd35..4fc3927 100644 --- a/mise.lock +++ b/mise.lock @@ -110,6 +110,34 @@ url = "https://dl.google.com/go/go1.26.1.darwin-amd64.tar.gz" checksum = "sha256:9b68112c913f45b7aebbf13c036721264bbba7e03a642f8f7490c561eebd1ecc" url = "https://dl.google.com/go/go1.26.1.windows-amd64.zip" +[[tools.lychee]] +version = "0.23.0" +backend = "aqua:lycheeverse/lychee" + +[tools.lychee."platforms.linux-arm64"] +checksum = "sha256:97eb93b02a7d78a752fc33e5b0983439ccaadbf3db952b68a0a4401acd92e6e0" +url = "https://github.com/lycheeverse/lychee/releases/download/lychee-v0.23.0/lychee-aarch64-unknown-linux-gnu.tar.gz" + +[tools.lychee."platforms.linux-arm64-musl"] +checksum = "sha256:97eb93b02a7d78a752fc33e5b0983439ccaadbf3db952b68a0a4401acd92e6e0" +url = "https://github.com/lycheeverse/lychee/releases/download/lychee-v0.23.0/lychee-aarch64-unknown-linux-gnu.tar.gz" + +[tools.lychee."platforms.linux-x64"] +checksum = "sha256:5538440d2c69a45a0a09983271e5dee0c2fe7137d8035d25b2632e10a66a090a" +url = "https://github.com/lycheeverse/lychee/releases/download/lychee-v0.23.0/lychee-x86_64-unknown-linux-musl.tar.gz" + +[tools.lychee."platforms.linux-x64-musl"] +checksum = "sha256:5538440d2c69a45a0a09983271e5dee0c2fe7137d8035d25b2632e10a66a090a" +url = "https://github.com/lycheeverse/lychee/releases/download/lychee-v0.23.0/lychee-x86_64-unknown-linux-musl.tar.gz" + +[tools.lychee."platforms.macos-arm64"] +checksum = "sha256:4c8034900e11083b68ac6f6582c377ff1f704e268991999e09d717973e493e7f" +url = "https://github.com/lycheeverse/lychee/releases/download/lychee-v0.23.0/lychee-arm64-macos.dmg" + +[tools.lychee."platforms.windows-x64"] +checksum = "sha256:0fda7ff0a60c0250939fc25361c2d4e6e7853c31c996733fdd5a1dd760bcb824" +url = "https://github.com/lycheeverse/lychee/releases/download/lychee-v0.23.0/lychee-x86_64-windows.exe" + [[tools.node]] version = "25.8.0" backend = "core:node" diff --git a/mise.toml b/mise.toml index b424d4e..630a48f 100644 --- a/mise.toml +++ b/mise.toml @@ -7,6 +7,7 @@ disable_backends = [ [tools] go = "latest" +lychee = "latest" "github:golangci/golangci-lint" = "latest" "github:houseabsolute/precious" = "latest" node = "latest" @@ -18,3 +19,7 @@ enter = "mise install --quiet" [[watch_files]] patterns = ["mise.toml", "mise.lock"] run = "mise install --quiet" + +[tasks.check-links] +description = "Check links with lychee" +run = "lychee --no-progress './**/*.md' './**/*.go'" From f152f507fc30e54d5181271d9360c52a263873cc Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Thu, 4 Jun 2026 20:48:45 +0000 Subject: [PATCH 2/3] Update stale and redirecting links Validated all links with lychee and updated the one that redirected: - README.md GoDoc badge: godoc.org/github.com/maxmind/xgbshap?status.png (301 -> pkg.go.dev) replaced with the canonical pkg.go.dev badge https://pkg.go.dev/badge/github.com/maxmind/xgbshap.svg Part of STF-557. Co-Authored-By: Claude Opus 4.8 (1M context) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c44fb48..9202240 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # xgbshap -[![GoDoc](https://godoc.org/github.com/maxmind/xgbshap?status.png)](https://pkg.go.dev/github.com/maxmind/xgbshap) +[![Go Reference](https://pkg.go.dev/badge/github.com/maxmind/xgbshap.svg)](https://pkg.go.dev/github.com/maxmind/xgbshap) This is a Go package for calculating feature contributions for [XGBoost](https://github.com/dmlc/xgboost) models. The code is ported from the From 29f2321871fcd34861088d7875cfd03595563f26 Mon Sep 17 00:00:00 2001 From: Gregory Oschwald Date: Thu, 4 Jun 2026 21:12:26 +0000 Subject: [PATCH 3/3] Add missing v prefix to action pin version comments Resolves zizmor ref-version-mismatch warnings on hash-pinned actions whose version comments omitted the leading v (the pinned commits already match the corresponding vX.Y.Z tags). Comment-only change. Part of STF-557. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/modver.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/modver.yml b/.github/workflows/modver.yml index 2441282..08d9b81 100644 --- a/.github/workflows/modver.yml +++ b/.github/workflows/modver.yml @@ -16,7 +16,7 @@ jobs: with: fetch-depth: 0 persist-credentials: false - - uses: bobg/modver@5b8d0533390faf5542fd9ab530ca3075c32a7201 # 2.14.1 + - uses: bobg/modver@5b8d0533390faf5542fd9ab530ca3075c32a7201 # v2.14.1 with: github_token: ${{ secrets.GITHUB_TOKEN }} pull_request_url: https://github.com/${{ github.repository }}/pull/${{ github.event.number }}