From 31d2ce7c279de79b1469dc6f59ebde05fdb34a31 Mon Sep 17 00:00:00 2001 From: Daniel Frankcom Date: Fri, 9 Oct 2026 11:05:01 -0700 Subject: [PATCH 1/8] Move the site build into a reusable action Signed-off-by: Daniel Frankcom --- .github/actions/build-site/action.yml | 68 +++++++++++++++++++++++++++ .github/workflows/zola-deploy.yml | 47 ++---------------- 2 files changed, 71 insertions(+), 44 deletions(-) create mode 100644 .github/actions/build-site/action.yml diff --git a/.github/actions/build-site/action.yml b/.github/actions/build-site/action.yml new file mode 100644 index 00000000..d8763ee3 --- /dev/null +++ b/.github/actions/build-site/action.yml @@ -0,0 +1,68 @@ +name: Build the website +description: > + Builds a checkout of this repository into /public, with its topics, clients and + commands from valkey-doc and the command metadata from valkey and the modules, checked out + next to it in the workspace. + +inputs: + path: + description: The website checkout to build, relative to the workspace (e.g. website). + required: true + checkout-content: + description: Check out the content repositories. Set to false if an earlier build in the job already did. + default: 'true' + +runs: + using: composite + steps: + - name: Checkout valkey + if: inputs.checkout-content == 'true' + uses: actions/checkout@v4 + with: + repository: valkey-io/valkey + path: valkey + + - name: Checkout valkey-bloom + if: inputs.checkout-content == 'true' + uses: actions/checkout@v4 + with: + repository: valkey-io/valkey-bloom + path: valkey-bloom + + - name: Checkout valkey-doc + if: inputs.checkout-content == 'true' + uses: actions/checkout@v4 + with: + repository: valkey-io/valkey-doc + path: valkey-doc + + - name: Checkout valkey-json + if: inputs.checkout-content == 'true' + uses: actions/checkout@v4 + with: + repository: valkey-io/valkey-json + path: valkey-json + + - name: Checkout valkey-search + if: inputs.checkout-content == 'true' + uses: actions/checkout@v4 + with: + repository: valkey-io/valkey-search + path: valkey-search + + - name: Init commands, topics and clients + shell: bash + working-directory: ${{ inputs.path }} + run: | + ./build/init-topics-and-clients.sh ../valkey-doc/topics \ + ../valkey-doc/clients + ./build/init-commands.sh ../valkey-doc/commands \ + ../valkey/src/commands ../valkey-bloom/src/commands \ + ../valkey-json/src/commands ../valkey-search/src/commands + + - name: Build only + uses: shalzz/zola-deploy-action@v0.22.0 + env: + BUILD_DIR: ${{ inputs.path }} + BUILD_ONLY: true + BUILD_THEMES: false diff --git a/.github/workflows/zola-deploy.yml b/.github/workflows/zola-deploy.yml index 9e39ec3d..bab3818f 100644 --- a/.github/workflows/zola-deploy.yml +++ b/.github/workflows/zola-deploy.yml @@ -24,51 +24,10 @@ jobs: ref: ${{ github.event_name != 'pull_request' && 'main' || '' }} path: website - - name: Checkout valkey-doc - uses: actions/checkout@v4 - with: - repository: valkey-io/valkey-doc - path: valkey-doc - - - name: Checkout valkey - uses: actions/checkout@v4 - with: - repository: valkey-io/valkey - path: valkey - - - name: Checkout valkey-bloom - uses: actions/checkout@v4 - with: - repository: valkey-io/valkey-bloom - path: valkey-bloom - - - name: Checkout valkey-search - uses: actions/checkout@v4 - with: - repository: valkey-io/valkey-search - path: valkey-search - - - name: Checkout valkey-json - uses: actions/checkout@v4 + - name: Build + uses: ./website/.github/actions/build-site with: - repository: valkey-io/valkey-json - path: valkey-json - - - name: Init commands, topics and clients - run: | - cd website - ./build/init-topics-and-clients.sh ../valkey-doc/topics \ - ../valkey-doc/clients - ./build/init-commands.sh ../valkey-doc/commands \ - ../valkey/src/commands ../valkey-bloom/src/commands \ - ../valkey-json/src/commands ../valkey-search/src/commands - - - name: Build only - uses: shalzz/zola-deploy-action@v0.22.0 - env: - BUILD_DIR: website - BUILD_ONLY: true - BUILD_THEMES: false + path: website - name: Upload artifact if: github.event_name != 'pull_request' From 1402181bf52d90f1a1547b54d7d3d4b769f98ae6 Mon Sep 17 00:00:00 2001 From: Daniel Frankcom Date: Fri, 9 Oct 2026 12:30:30 -0700 Subject: [PATCH 2/8] Check internal links on pull requests Signed-off-by: Daniel Frankcom --- .github/workflows/link-check.yml | 74 ++++++++++++++++++++++++++++++++ README.md | 11 +++++ build/broken-links.sh | 26 +++++++++++ build/compare-link-failures.sh | 53 +++++++++++++++++++++++ build/lychee.toml | 7 +++ build/unconverted-doc-links.sh | 22 ++++++++++ 6 files changed, 193 insertions(+) create mode 100644 .github/workflows/link-check.yml create mode 100755 build/broken-links.sh create mode 100755 build/compare-link-failures.sh create mode 100644 build/lychee.toml create mode 100755 build/unconverted-doc-links.sh diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml new file mode 100644 index 00000000..ca203f6b --- /dev/null +++ b/.github/workflows/link-check.yml @@ -0,0 +1,74 @@ +# Builds the site before and after the PR. Fails if the PR breaks internal links. +# Links already broken before the PR are listed but don't fail the check. + +name: Link check + +on: + pull_request: + branches: ["main"] + +permissions: + contents: read + +concurrency: + group: link-check-${{ github.event.pull_request.number }} + cancel-in-progress: true + +jobs: + internal-links: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + path: website + fetch-depth: 0 # for the base commit + + - name: Check out the base commit + env: + BASE_SHA: ${{ github.event.pull_request.base.sha }} + run: git -C website worktree add --detach ../base "$BASE_SHA" + + # Each side uses its own build-site, so changes to the build itself are checked too. + # If the base doesn't build or has no build-site, the checks list every broken link + # instead. + - name: Build this PR + id: head + uses: ./website/.github/actions/build-site + with: + path: website + + - name: Build the base + id: base + if: hashFiles('base/.github/actions/build-site/action.yml') != '' + continue-on-error: true + uses: ./base/.github/actions/build-site + with: + path: base + checkout-content: false + + - name: Install lychee + env: + LYCHEE_VERSION: v0.24.2 + run: | + curl -sSfL "https://github.com/lycheeverse/lychee/releases/download/lychee-${LYCHEE_VERSION}/lychee-x86_64-unknown-linux-gnu.tar.gz" \ + | tar -xz -C "$RUNNER_TEMP" --strip-components=1 lychee-x86_64-unknown-linux-gnu/lychee + echo "$RUNNER_TEMP" >> "$GITHUB_PATH" + + - name: Missing pages and anchors + if: ${{ !cancelled() && steps.head.outcome == 'success' }} + env: + BASE_BUILT: ${{ steps.base.outcome == 'success' }} + run: | + if [ "$BASE_BUILT" = true ]; then ./website/build/broken-links.sh base/public > broken-before.txt; fi + ./website/build/broken-links.sh website/public > broken-after.txt + ./website/build/compare-link-failures.sh broken-before.txt broken-after.txt + + - name: valkey-doc links the site doesn't convert + if: ${{ !cancelled() && steps.head.outcome == 'success' }} + env: + BASE_BUILT: ${{ steps.base.outcome == 'success' }} + run: | + if [ "$BASE_BUILT" = true ]; then ./website/build/unconverted-doc-links.sh base/public > unconverted-before.txt; fi + ./website/build/unconverted-doc-links.sh website/public > unconverted-after.txt + ./website/build/compare-link-failures.sh unconverted-before.txt unconverted-after.txt diff --git a/README.md b/README.md index 8b0c4824..73bc2967 100644 --- a/README.md +++ b/README.md @@ -93,6 +93,17 @@ Point your browser at `http://127.0.0.1:1111/commands/` and you should see the f All files created in this process are ignored by git. Commit your changes to your local copy of `valkey-io/valkey-doc` for description changes and `valkey-io/valkey` for command JSON changes (if you have any). +### Checking links + +Pull requests check the built site for links to missing pages or `#anchors`, and for valkey-doc links that weren't converted to site URLs. +To run the checks locally (needs [lychee](https://lychee.cli.rs/) and jq), set up the topics and commands as above, then: + +```shell +zola build +build/broken-links.sh public +build/unconverted-doc-links.sh public +``` + ## License This project is licensed under the BSD-3-Clause License. diff --git a/build/broken-links.sh b/build/broken-links.sh new file mode 100755 index 00000000..73e5750d --- /dev/null +++ b/build/broken-links.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# Lists links in a built site to missing pages or #anchors. +# +# build/broken-links.sh public +set -euo pipefail +site=$(cd "${1:?usage: broken-links.sh }" && pwd -P) +report=$(mktemp) + +status=0 +# --offline skips links written as https://valkey.io/..., so point them at the build. +lychee --offline --no-progress --format json --output "$report" --config "$(dirname "$0")/lychee.toml" \ + --root-dir "$site" --remap "^https://valkey\.io/([^?#]*)[^#]*(#.*)?$ file://$site/\$1\$2" \ + "$site" > /dev/null || status=$? +case $status in + 0 | 2) ;; # 2 means lychee found broken links + *) echo "lychee itself failed (exit code $status)" >&2; exit 1 ;; +esac + +jq -r --arg root "$site" '.error_map | to_entries[] | .key as $page | .value[] + | (.url | ltrimstr("file://" + $root)) as $link + | ($page | ltrimstr($root) | rtrimstr("index.html")) as $on + | (if (.status.text | startswith("Cannot find fragment")) then "but that page has no #\($link | split("#") | last) anchor" + elif (.status.text | startswith("File not found")) then "but no such page exists" + else .status.text end) as $problem + | [$link, "\($on) links to \($link), \($problem)"] | @tsv' "$report" \ + | sort -u diff --git a/build/compare-link-failures.sh b/build/compare-link-failures.sh new file mode 100755 index 00000000..f4126311 --- /dev/null +++ b/build/compare-link-failures.sh @@ -0,0 +1,53 @@ +#!/usr/bin/env bash +# Prints failures from broken-links.sh or unconverted-doc-links.sh. +# +# build/compare-link-failures.sh +# Fails if a link in isn't in . If doesn't exist (the base +# didn't build), lists everything as below. +# build/compare-link-failures.sh - +# Fails if there are any failures. +# +# Compares links, not pages, so a new page that inherits a dead footer link doesn't fail. +set -euo pipefail +before=${1:?usage: compare-link-failures.sh } after=${2:?} + +if [ "$before" != - ] && [ ! -e "$before" ]; then + echo "The base commit didn't build, so every broken link is listed." + before=- +fi + +if [ "$before" = - ]; then + if [ ! -s "$after" ]; then + echo "No broken links." + exit 0 + fi + echo "Broken links ($(wc -l < "$after" | tr -d ' ')):" + cut -f2 "$after" | sed 's/^/::error::/' + exit 1 +fi + +new_links=$(comm -13 <(cut -f1 "$before" | sort -u) <(cut -f1 "$after" | sort -u)) + +# Each failure is "linkmessage". Group the messages by whether their link is new. +new=() already=() +while IFS=$'\t' read -r link message; do + if grep -qxF -- "$link" <<< "$new_links"; then + new+=("$message") + else + already+=("$message") + fi +done < "$after" + +if [ ${#new[@]} -gt 0 ]; then + echo "Broken by this change (${#new[@]}):" + printf '::error::%s\n' "${new[@]}" +else + echo "This change doesn't break any links." +fi +if [ ${#already[@]} -gt 0 ]; then + echo "Already broken before this change (${#already[@]}):" + printf ' %s\n' "${already[@]}" +fi +if [ ${#new[@]} -gt 0 ]; then + exit 1 +fi diff --git a/build/lychee.toml b/build/lychee.toml new file mode 100644 index 00000000..5b044913 --- /dev/null +++ b/build/lychee.toml @@ -0,0 +1,7 @@ +# Used by build/broken-links.sh. + +# Not "full", because lychee's #:~:text= fragment checking is new and was unreliable in testing. +include_fragments = "anchor-only" + +# Zola writes /topics/foo/ as topics/foo/index.html. +index_files = ["index.html"] diff --git a/build/unconverted-doc-links.sh b/build/unconverted-doc-links.sh new file mode 100755 index 00000000..0159122d --- /dev/null +++ b/build/unconverted-doc-links.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +# Lists valkey-doc links that fix_links (templates/macros/) didn't convert to site URLs. +# The browser resolves these against the page URL, so they can open the wrong page. +# For example, ../clients/ on /topics/installation/ opens /topics/clients/. +# +# build/unconverted-doc-links.sh public +set -euo pipefail +cd "${1:?usage: unconverted-doc-links.sh }" + +# hrefs on topic and command pages that still start with ../ or point at a .md file, as +# valkey-doc writes them. [^":] skips links with a scheme, such as https://…/README.md. +unconverted='href="(\.\./[^"]*|[^":]*\.md(#[^"]*)?)"' + +# grep prints one "topics/x/index.html:href=\"../y.md\"" per match. It exits 1 when nothing +# matches, which means the site is clean. +{ grep -roE "$unconverted" topics commands --include=index.html || [ $? -eq 1 ]; } | + while IFS= read -r match; do + page=/${match%%index.html:*} # topics/x/index.html:… → /topics/x/ + link=${match#*:href=\"} # …:href="../y.md" → ../y.md" + link=${link%\"} # → ../y.md + printf '%s\t%s links to %s, a valkey-doc link that was not converted to a site URL\n' "$link" "$page" "$link" + done | sort -u From a0bbe0cdb6db72ccaec45944a42d66fb91e78614 Mon Sep 17 00:00:00 2001 From: Daniel Frankcom Date: Fri, 9 Oct 2026 14:05:08 -0700 Subject: [PATCH 3/8] Move the link checks into a reusable action Signed-off-by: Daniel Frankcom --- .github/actions/check-links/action.yml | 43 ++++++++++++++++++++++++++ .github/workflows/link-check.yml | 33 ++++++-------------- 2 files changed, 52 insertions(+), 24 deletions(-) create mode 100644 .github/actions/check-links/action.yml diff --git a/.github/actions/check-links/action.yml b/.github/actions/check-links/action.yml new file mode 100644 index 00000000..a76ab9e9 --- /dev/null +++ b/.github/actions/check-links/action.yml @@ -0,0 +1,43 @@ +name: Check the website's links +description: > + Checks a built site (/public) for links to missing pages or #anchors. If base-path is + provided, only surfaces issues that don't appear in both. + +inputs: + path: + description: The website to check the build for, relative to the workspace (e.g. website). + required: true + base-path: + description: A checkout of the base commit to compare with. If it has no public directory, every broken link is listed. + default: '' + +runs: + using: composite + steps: + - name: Install lychee + shell: bash + env: + LYCHEE_VERSION: v0.24.2 + run: | + curl -sSfL "https://github.com/lycheeverse/lychee/releases/download/lychee-${LYCHEE_VERSION}/lychee-x86_64-unknown-linux-gnu.tar.gz" \ + | tar -xz -C "$RUNNER_TEMP" --strip-components=1 lychee-x86_64-unknown-linux-gnu/lychee + echo "$RUNNER_TEMP" >> "$GITHUB_PATH" + + - name: Check links + shell: bash + env: + CHECKOUT: ${{ inputs.path }} + BASE_CHECKOUT: ${{ inputs.base-path }} + run: | + status=0 + for check in broken-links unconverted-doc-links; do + echo "build/$check.sh:" + before=- + if [ -n "$BASE_CHECKOUT" ]; then + before=$RUNNER_TEMP/$check-before.txt + if [ -d "$BASE_CHECKOUT/public" ]; then "$CHECKOUT/build/$check.sh" "$BASE_CHECKOUT/public" > "$before"; fi + fi + "$CHECKOUT/build/$check.sh" "$CHECKOUT/public" > "$RUNNER_TEMP/$check.txt" + "$CHECKOUT/build/compare-link-failures.sh" "$before" "$RUNNER_TEMP/$check.txt" || status=1 + done + exit "$status" diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml index ca203f6b..a87d2f35 100644 --- a/.github/workflows/link-check.yml +++ b/.github/workflows/link-check.yml @@ -47,28 +47,13 @@ jobs: path: base checkout-content: false - - name: Install lychee - env: - LYCHEE_VERSION: v0.24.2 - run: | - curl -sSfL "https://github.com/lycheeverse/lychee/releases/download/lychee-${LYCHEE_VERSION}/lychee-x86_64-unknown-linux-gnu.tar.gz" \ - | tar -xz -C "$RUNNER_TEMP" --strip-components=1 lychee-x86_64-unknown-linux-gnu/lychee - echo "$RUNNER_TEMP" >> "$GITHUB_PATH" - - - name: Missing pages and anchors - if: ${{ !cancelled() && steps.head.outcome == 'success' }} - env: - BASE_BUILT: ${{ steps.base.outcome == 'success' }} - run: | - if [ "$BASE_BUILT" = true ]; then ./website/build/broken-links.sh base/public > broken-before.txt; fi - ./website/build/broken-links.sh website/public > broken-after.txt - ./website/build/compare-link-failures.sh broken-before.txt broken-after.txt + # A failed build can leave part of a site, which could hide links the PR breaks. + - name: Discard a failed base build + if: steps.base.outcome == 'failure' + run: rm -rf base/public - - name: valkey-doc links the site doesn't convert - if: ${{ !cancelled() && steps.head.outcome == 'success' }} - env: - BASE_BUILT: ${{ steps.base.outcome == 'success' }} - run: | - if [ "$BASE_BUILT" = true ]; then ./website/build/unconverted-doc-links.sh base/public > unconverted-before.txt; fi - ./website/build/unconverted-doc-links.sh website/public > unconverted-after.txt - ./website/build/compare-link-failures.sh unconverted-before.txt unconverted-after.txt + - name: Check links + uses: ./website/.github/actions/check-links + with: + path: website + base-path: base From 504c0f6b4efb1bd7119b914e5daec513305abf60 Mon Sep 17 00:00:00 2001 From: Daniel Frankcom Date: Fri, 9 Oct 2026 12:30:31 -0700 Subject: [PATCH 4/8] Report broken internal links on deploys Signed-off-by: Daniel Frankcom --- .github/workflows/zola-deploy.yml | 32 +++++++++++++++++++++++++++++++ README.md | 2 +- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/.github/workflows/zola-deploy.yml b/.github/workflows/zola-deploy.yml index bab3818f..a1adfa36 100644 --- a/.github/workflows/zola-deploy.yml +++ b/.github/workflows/zola-deploy.yml @@ -17,6 +17,10 @@ permissions: jobs: build: runs-on: ubuntu-latest + outputs: + # Stores the link check result. We don't want this to block deployments, so + # a separate job marks the run as failed instead. + link-check-outcome: ${{ steps.links.outcome }} steps: - name: Checkout uses: actions/checkout@v4 @@ -29,6 +33,17 @@ jobs: with: path: website + # Checks the links without blocking the deploy. Most broken links are in content from other + # repositories (valkey-doc, valkey and the modules), and blocking would hold back site updates + # until they're fixed there. + - name: Check links + id: links + if: github.event_name != 'pull_request' + continue-on-error: true + uses: ./website/.github/actions/check-links + with: + path: website + - name: Upload artifact if: github.event_name != 'pull_request' uses: actions/upload-pages-artifact@v3 @@ -46,3 +61,20 @@ jobs: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4 + + # Marks the run as failed if the link check failed, so broken links are noticed without blocking + # deployments. + links: + if: github.event_name != 'pull_request' + runs-on: ubuntu-latest + needs: build + steps: + - name: Internal links + env: + OUTCOME: ${{ needs.build.outputs.link-check-outcome }} + run: | + if [ "$OUTCOME" != "success" ]; then + echo "::error::Internal links fail on the deployed site. See the build job's log for the list." + exit 1 + fi + echo "Every internal link passes." diff --git a/README.md b/README.md index 73bc2967..09abaea4 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ Commit your changes to your local copy of `valkey-io/valkey-doc` for description ### Checking links -Pull requests check the built site for links to missing pages or `#anchors`, and for valkey-doc links that weren't converted to site URLs. +Pull requests and deploys check the built site for links to missing pages or `#anchors`, and for valkey-doc links that weren't converted to site URLs. To run the checks locally (needs [lychee](https://lychee.cli.rs/) and jq), set up the topics and commands as above, then: ```shell From a03d4b8572b667a75598afc64d7b379cb98439dc Mon Sep 17 00:00:00 2001 From: Daniel Frankcom Date: Fri, 23 Oct 2026 17:05:35 -0700 Subject: [PATCH 5/8] Compare unconverted doc links by page and link Signed-off-by: Daniel Frankcom --- build/unconverted-doc-links.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build/unconverted-doc-links.sh b/build/unconverted-doc-links.sh index 0159122d..f1517506 100755 --- a/build/unconverted-doc-links.sh +++ b/build/unconverted-doc-links.sh @@ -13,10 +13,12 @@ unconverted='href="(\.\./[^"]*|[^":]*\.md(#[^"]*)?)"' # grep prints one "topics/x/index.html:href=\"../y.md\"" per match. It exits 1 when nothing # matches, which means the site is clean. +# Keyed by page too, since the same link opens a different page under topics and commands. { grep -roE "$unconverted" topics commands --include=index.html || [ $? -eq 1 ]; } | while IFS= read -r match; do page=/${match%%index.html:*} # topics/x/index.html:… → /topics/x/ link=${match#*:href=\"} # …:href="../y.md" → ../y.md" link=${link%\"} # → ../y.md - printf '%s\t%s links to %s, a valkey-doc link that was not converted to a site URL\n' "$link" "$page" "$link" + printf '%s\t%s links to %s, a valkey-doc link that was not converted to a site URL\n' \ + "$page $link" "$page" "$link" done | sort -u From cca326c5580c4ee9811391989738b5f69c9ae984 Mon Sep 17 00:00:00 2001 From: Daniel Frankcom Date: Tue, 27 Oct 2026 10:14:19 -0700 Subject: [PATCH 6/8] Group deploy checks by blocking Signed-off-by: Daniel Frankcom --- .github/workflows/zola-deploy.yml | 56 +++++++++++++++---------------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/.github/workflows/zola-deploy.yml b/.github/workflows/zola-deploy.yml index 43becbc2..0fb8da39 100644 --- a/.github/workflows/zola-deploy.yml +++ b/.github/workflows/zola-deploy.yml @@ -19,9 +19,6 @@ jobs: runs-on: ubuntu-latest outputs: commit: ${{ steps.checkout.outputs.commit }} - # Stores the link check result. We don't want this to block deployments, so - # a separate job marks the run as failed instead. - link-check-outcome: ${{ steps.links.outcome }} steps: - name: Checkout id: checkout @@ -35,24 +32,14 @@ jobs: with: path: website - # Checks the links without blocking the deploy. Most broken links are in content from other - # repositories (valkey-doc, valkey and the modules), and blocking would hold back site updates - # until they're fixed there. - - name: Check links - id: links - if: github.event_name != 'pull_request' - continue-on-error: true - uses: ./website/.github/actions/check-links - with: - path: website - - name: Upload artifact if: github.event_name != 'pull_request' uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3 with: path: ./website/public - validate: + # Deploys wait for these. + blocking-checks: needs: build if: github.event_name != 'pull_request' uses: ./.github/workflows/validate-libraries.yml @@ -67,25 +54,36 @@ jobs: name: github-pages url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest - needs: [build, validate] + needs: [build, blocking-checks] steps: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4 - # Marks the run as failed if the link check failed, so broken links are noticed without blocking - # deployments. - links: + # Deploys don't wait for these. The target of these checks comes from other repositories + # (valkey-doc, valkey, etc.), so blocking would hold back site updates until external fixes could + # be made. The checks here are intended as primarily informational. + non-blocking-checks: + needs: build if: github.event_name != 'pull_request' runs-on: ubuntu-latest - needs: build + permissions: + contents: read steps: - - name: Internal links - env: - OUTCOME: ${{ needs.build.outputs.link-check-outcome }} - run: | - if [ "$OUTCOME" != "success" ]; then - echo "::error::Internal links fail on the deployed site. See the build job's log for the list." - exit 1 - fi - echo "Every internal link passes." + - name: Checkout + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 + with: + ref: ${{ needs.build.outputs.commit }} + + - name: Download the built site + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 + with: + name: github-pages + + - name: Unpack the built site + run: mkdir public && tar -xf artifact.tar -C public + + - name: Check links + uses: ./.github/actions/check-links + with: + path: . From 9e1880424264bec8043d6a82666ef7a89be4c60b Mon Sep 17 00:00:00 2001 From: Daniel Frankcom Date: Tue, 27 Oct 2026 11:21:47 -0700 Subject: [PATCH 7/8] Empty commit - trigger workflow after upstream fix Signed-off-by: Daniel Frankcom From 28e48078e27e9ca0b7d190106b5cdc3cc3f2756f Mon Sep 17 00:00:00 2001 From: Madelyn Olson Date: Thu, 29 Oct 2026 19:46:16 -0700 Subject: [PATCH 8/8] Apply batched suggestions from code review Co-authored-by: Madelyn Olson Signed-off-by: Madelyn Olson --- .github/actions/check-links/action.yml | 7 +++++-- build/compare-link-failures.sh | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/actions/check-links/action.yml b/.github/actions/check-links/action.yml index a76ab9e9..159d22b0 100644 --- a/.github/actions/check-links/action.yml +++ b/.github/actions/check-links/action.yml @@ -18,9 +18,12 @@ runs: shell: bash env: LYCHEE_VERSION: v0.24.2 + LYCHEE_SHA256: 1f4e0ef7f6554a6ed33dd7ac144fb2e1bbed98598e7af973042fc5cd43951c9a run: | - curl -sSfL "https://github.com/lycheeverse/lychee/releases/download/lychee-${LYCHEE_VERSION}/lychee-x86_64-unknown-linux-gnu.tar.gz" \ - | tar -xz -C "$RUNNER_TEMP" --strip-components=1 lychee-x86_64-unknown-linux-gnu/lychee + curl -sSfL -o "$RUNNER_TEMP/lychee.tar.gz" \ + "https://github.com/lycheeverse/lychee/releases/download/lychee-${LYCHEE_VERSION}/lychee-x86_64-unknown-linux-gnu.tar.gz" + echo "$LYCHEE_SHA256 $RUNNER_TEMP/lychee.tar.gz" | sha256sum -c - + tar -xzf "$RUNNER_TEMP/lychee.tar.gz" -C "$RUNNER_TEMP" --strip-components=1 lychee-x86_64-unknown-linux-gnu/lychee echo "$RUNNER_TEMP" >> "$GITHUB_PATH" - name: Check links diff --git a/build/compare-link-failures.sh b/build/compare-link-failures.sh index f4126311..2f587bcf 100755 --- a/build/compare-link-failures.sh +++ b/build/compare-link-failures.sh @@ -7,7 +7,8 @@ # build/compare-link-failures.sh - # Fails if there are any failures. # -# Compares links, not pages, so a new page that inherits a dead footer link doesn't fail. +# Compares the first field of each failure. broken-links.sh puts only the link there, so a new +# page that inherits a dead footer link doesn't fail. set -euo pipefail before=${1:?usage: compare-link-failures.sh } after=${2:?}