From fb4a6d12a75a91d2e1db0dc6533c877b7886e449 Mon Sep 17 00:00:00 2001 From: pluja Date: Sat, 4 Jul 2026 18:10:54 +0300 Subject: [PATCH] ci: fix lychee --accept quoting and bump checkout to v5 (refs #903) --- .github/workflows/health-report.yml | 16 ++++++++++------ .github/workflows/pr-lint.yml | 6 +++--- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/health-report.yml b/.github/workflows/health-report.yml index 6757b2a..346e6e7 100644 --- a/.github/workflows/health-report.yml +++ b/.github/workflows/health-report.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Run lychee on README.md uses: lycheeverse/lychee-action@v2 @@ -34,7 +34,7 @@ jobs: --retry-wait-time 2 --timeout 20 --exclude-mail - --accept '200..=299,403,429,999' + --accept 200..=299,403,429,999 README.md format: json output: lychee/out.json @@ -57,6 +57,7 @@ jobs: # ---- 1. Dead links, from the lychee JSON report ------------------------ dead = [] + dead_ok = True try: with open("lychee/out.json") as fh: data = json.load(fh) @@ -68,8 +69,10 @@ jobs: text = status.get("text") or status.get("details") or "error" dead.append((url, text)) except FileNotFoundError: + dead_ok = False print("::warning::lychee/out.json not found; skipping dead-link section") except Exception as exc: + dead_ok = False print(f"::warning::Could not parse lychee output ({exc})") # De-duplicate while keeping order. seen = set() @@ -167,13 +170,14 @@ jobs: lines.append("") lines.append(f"## Dead links ({len(dead)})") + lines.append("") if dead: - lines.append("") for url, text in dead: lines.append(f"- {url} - {text}") - else: - lines.append("") + elif dead_ok: lines.append("None found.") + else: + lines.append("_Link scan produced no output this run; dead links were not checked._") lines.append("") lines.append(f"## Stale or archived repositories ({len(stale)})") @@ -197,7 +201,7 @@ jobs: with open("health-report.md", "w", encoding="utf-8") as fh: fh.write("\n".join(lines) + "\n") - has_findings = bool(dead or stale) + has_findings = bool(dead or stale or not dead_ok) out = os.environ.get("GITHUB_OUTPUT") if out: with open(out, "a") as fh: diff --git a/.github/workflows/pr-lint.yml b/.github/workflows/pr-lint.yml index 0536e8d..74fb3bb 100644 --- a/.github/workflows/pr-lint.yml +++ b/.github/workflows/pr-lint.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Run lychee on README.md uses: lycheeverse/lychee-action@v2 @@ -37,7 +37,7 @@ jobs: --retry-wait-time 2 --timeout 20 --exclude-mail - --accept '100..=103,200..=299,403,429,500,502,503,504,999' + --accept 100..=103,200..=299,403,429,500,502,503,504,999 README.md format: markdown output: lychee/out.md @@ -50,7 +50,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: fetch-depth: 0