From 7767e1e01931ca940eb1ff3667bd610a44603aef Mon Sep 17 00:00:00 2001 From: manuka rahul <96047526+rahulpinto19@users.noreply.github.com> Date: Mon, 9 Feb 2026 05:59:31 +0000 Subject: [PATCH] ci: optimize link checker workflow and failure reporting (#2411) The current system streamlines troubleshooting by omitting passing links from the output. Reporting now focuses solely on: - Broken or failing links - Redirecting links - File paths (now prioritized at the top of the log for rapid identification) The link resolution notice is now presented first, followed by specific errors to prevent developer distraction. The .lycheeignore file has been updated to use regular expressions for broader coverage of npm and SQL links, replacing the previous method of listing individual URLs. --------- Co-authored-by: Twisha Bansal <58483338+twishabansal@users.noreply.github.com> --- .github/workflows/link_checker_workflow.yaml | 26 +++++++++++++------- .lycheeignore | 10 +++----- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/.github/workflows/link_checker_workflow.yaml b/.github/workflows/link_checker_workflow.yaml index ae51a4b08b..591221d16e 100644 --- a/.github/workflows/link_checker_workflow.yaml +++ b/.github/workflows/link_checker_workflow.yaml @@ -32,29 +32,37 @@ jobs: restore-keys: cache-lychee- - name: Link Checker + id: lychee-check uses: lycheeverse/lychee-action@a8c4c7cb88f0c7386610c35eb25108e448569cb0 # v2 + continue-on-error: true with: args: > - --verbose + --quiet --no-progress --cache --max-cache-age 1d --exclude '^neo4j\+.*' --exclude '^bolt://.*' README.md docs/ - output: /tmp/foo.txt - fail: true - jobSummary: true - debug: true + output: lychee-report.md + format: markdown + fail: true + jobSummary: false + debug: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # This step only runs if the 'lychee_check' step fails, ensuring the - # context note only appears when the developer needs to troubleshoot. - - name: Display Link Context Note on Failure - if: ${{ failure() }} + + - name: Display Failure Report + # Run this ONLY if the link checker failed + if: steps.lychee-check.outcome == 'failure' run: | echo "## Link Resolution Note" >> $GITHUB_STEP_SUMMARY echo "Local links and directory changes work differently on GitHub than on the docsite." >> $GITHUB_STEP_SUMMARY echo "You must ensure fixes pass the **GitHub check** and also work with **\`hugo server\`**." >> $GITHUB_STEP_SUMMARY + echo "See [Link Checking and Fixing with Lychee](https://github.com/googleapis/genai-toolbox/blob/main/DEVELOPER.md#link-checking-and-fixing-with-lychee) for more details." >> $GITHUB_STEP_SUMMARY echo "---" >> $GITHUB_STEP_SUMMARY + echo "### Broken Links Found" >> $GITHUB_STEP_SUMMARY + cat ./lychee-report.md >> $GITHUB_STEP_SUMMARY + + exit 1 diff --git a/.lycheeignore b/.lycheeignore index 9ce08c5e6a..236e2c8394 100644 --- a/.lycheeignore +++ b/.lycheeignore @@ -23,8 +23,7 @@ https://cloud.dgraph.io/login https://dgraph.io/docs # MySQL Community downloads and main site (often protected by bot mitigation) -https://dev.mysql.com/downloads/installer/ -https://www.mysql.com/ +^https?://(.*\.)?mysql\.com/.* # Claude desktop download link https://claude.ai/download @@ -37,10 +36,9 @@ https://dev.mysql.com/doc/refman/8.4/en/sql-prepared-statements.html https://dev.mysql.com/doc/refman/8.4/en/user-names.html # npmjs links can occasionally trigger rate limiting during high-frequency CI builds -https://www.npmjs.com/package/@toolbox-sdk/adk -https://www.npmjs.com/package/@toolbox-sdk/core -https://www.npmjs.com/package/@toolbox-sdk/server +^https?://(www\.)?npmjs\.com/.* + https://www.oceanbase.com/ # Ignore social media and blog profiles to reduce external request overhead -https://medium.com/@mcp_toolbox +https://medium.com/@mcp_toolbox \ No newline at end of file