From a44b7ca8efdde302f3b037525d34767469f80f73 Mon Sep 17 00:00:00 2001 From: rahulpinto19 Date: Wed, 11 Feb 2026 10:15:38 +0000 Subject: [PATCH] add weekly report --- .github/workflows/link_checker_report.yaml | 72 ++++++++++++++++++++ .github/workflows/link_checker_workflow.yaml | 8 +-- 2 files changed, 74 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/link_checker_report.yaml diff --git a/.github/workflows/link_checker_report.yaml b/.github/workflows/link_checker_report.yaml new file mode 100644 index 0000000000..ed73ad2c3f --- /dev/null +++ b/.github/workflows/link_checker_report.yaml @@ -0,0 +1,72 @@ +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +name: Weekly Link Check + +on: + # Run automatically every Monday at 00:00 UTC + schedule: + - cron: '0 0 * * 1' + # Optional: Keep this to allow manual triggering from the Actions tab + workflow_dispatch: + + +jobs: + link-check: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 + + - name: Restore lychee cache + uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5 + with: + path: .lycheecache + key: cache-lychee-${{ github.sha }} + restore-keys: cache-lychee- + + - name: Link Checker + id: lychee-check + uses: lycheeverse/lychee-action@a8c4c7cb88f0c7386610c35eb25108e448569cb0 # v2 + continue-on-error: true + with: + args: > + --quiet + --no-progress + --cache + --max-cache-age 1d + --exclude '^neo4j\+.*' --exclude '^bolt://.*' + README.md + docs/ + output: lychee-report.md + format: markdown + fail: true + jobSummary: false + debug: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - 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/.github/workflows/link_checker_workflow.yaml b/.github/workflows/link_checker_workflow.yaml index ed73ad2c3f..591221d16e 100644 --- a/.github/workflows/link_checker_workflow.yaml +++ b/.github/workflows/link_checker_workflow.yaml @@ -11,14 +11,10 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -name: Weekly Link Check +name: Link Checker on: - # Run automatically every Monday at 00:00 UTC - schedule: - - cron: '0 0 * * 1' - # Optional: Keep this to allow manual triggering from the Actions tab - workflow_dispatch: + pull_request: jobs: