From 58d5c439c65637b23fe0cb5b8bd2673a1959d7f4 Mon Sep 17 00:00:00 2001 From: Evagan2018 Date: Fri, 17 Apr 2026 16:11:13 +0200 Subject: [PATCH 1/2] Updated lychee settings. --- .github/workflows/link-check.yml | 51 ++++++++++++++++++++++++++++---- .lycheeignore | 7 +++++ 2 files changed, 53 insertions(+), 5 deletions(-) create mode 100644 .lycheeignore diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml index 9d66b68..1815df7 100644 --- a/.github/workflows/link-check.yml +++ b/.github/workflows/link-check.yml @@ -4,24 +4,65 @@ on: pull_request: paths: - "profile/**/*.md" + - ".lycheeignore" + - ".github/workflows/link-check.yml" + push: paths: - "profile/**/*.md" + - ".lycheeignore" + - ".github/workflows/link-check.yml" + schedule: - cron: "0 20 * * 0" # Sundays 20:00 UTC + workflow_dispatch: +concurrency: + group: lychee-${{ github.ref }} + cancel-in-progress: true + jobs: link-check: runs-on: ubuntu-latest permissions: - issues: write # Required for peter-evans/create-issue-from-file + contents: read steps: - - uses: actions/checkout@v5 + - uses: actions/checkout@v6 - - name: Check links in md files + # Using a progressive relaxation strategy that maximizes cache reuse without breaking correctness. + - name: Restore lychee cache + id: lychee-cache + uses: actions/cache/restore@v5 + with: + path: .lycheecache + key: lychee-${{ runner.os }}-${{ github.ref_name }}-${{ hashFiles('.lycheeignore', 'profile/**/*.md') }} + restore-keys: | + lychee-${{ runner.os }}-${{ github.ref_name }}- + lychee-${{ runner.os }}- + + - name: Check links in Markdown files uses: lycheeverse/lychee-action@v2 with: - # Only check markdown in the profile folder - args: --root-dir "$(pwd)" --verbose --no-progress --accept 200,206,429 --timeout 20 --max-retries 2 "profile/**/*.md" + token: ${{ secrets.GITHUB_TOKEN }} + fail: true + args: > + --root-dir "$(pwd)" + --no-progress + --cache + --max-cache-age 1d + --accept 200,206,429 + --header "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" + --user-agent "curl/8.4.0" + --timeout 20 + --max-retries 2 + --max-redirects 5 + "profile/**/*.md" + + - name: Save lychee cache + if: always() && steps.lychee-cache.outputs.cache-hit != 'true' + uses: actions/cache/save@v5 + with: + path: .lycheecache + key: lychee-${{ runner.os }}-${{ github.ref_name }}-${{ hashFiles('.lycheeignore', 'profile/**/*.md') }} \ No newline at end of file diff --git a/.lycheeignore b/.lycheeignore new file mode 100644 index 0000000..dd93338 --- /dev/null +++ b/.lycheeignore @@ -0,0 +1,7 @@ +# Known intentional bad example + + +# Known false positive / environment-sensitive +https://www.raspberrypi.com/software +https://www.raspberrypi.com/software/ +https://www.st.com/en/embedded-software/x-cube-stl.html \ No newline at end of file From 0cbb82a3f48da5c9e6f50294bfdba919fcc67c2c Mon Sep 17 00:00:00 2001 From: Evagan2018 Date: Fri, 17 Apr 2026 16:14:10 +0200 Subject: [PATCH 2/2] Set max redirects to 2 --- .github/workflows/link-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml index 1815df7..4bf4926 100644 --- a/.github/workflows/link-check.yml +++ b/.github/workflows/link-check.yml @@ -57,7 +57,7 @@ jobs: --user-agent "curl/8.4.0" --timeout 20 --max-retries 2 - --max-redirects 5 + --max-redirects 2 "profile/**/*.md" - name: Save lychee cache