From 3b722214fa19d3e678cc4fab05b6ef0b11bcd8da Mon Sep 17 00:00:00 2001 From: Tom Wu Date: Thu, 7 May 2026 11:12:12 -0400 Subject: [PATCH] Auto-open issue when scheduled lychee finds broken links MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: - link-check-online.yml: lychee runs with fail:false, then create-issue-from-file opens an issue with the broken-link report when exit_code is non-zero - Workflow gets contents:read + issues:write permissions for the issue creation Changed files: - .github/workflows/link-check-online.yml: switch fail:true → fail:false; add issue-creation step gated on lychee exit code; add permissions block Validation: - Local scripts/check.sh runs clean across all four tiers (lychee + typos installed) - Workflow YAML structure mirrors the canonical lychee-action README example Follow-ups: - First scheduled run is Sunday at 13:00 UTC; can also trigger manually via workflow_dispatch - Issues will be labelled link-rot and automated for filtering Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/link-check-online.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/link-check-online.yml b/.github/workflows/link-check-online.yml index 9f4287f..39ab818 100644 --- a/.github/workflows/link-check-online.yml +++ b/.github/workflows/link-check-online.yml @@ -5,13 +5,29 @@ on: - cron: '0 13 * * 0' # 13:00 UTC every Sunday workflow_dispatch: +permissions: + contents: read + issues: write + jobs: lychee-online: name: lychee (network) runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: lycheeverse/lychee-action@v2 + - name: Link Checker + id: lychee + uses: lycheeverse/lychee-action@v2 with: args: --verbose --no-progress '**/*.md' - fail: true + fail: false + + - name: Create issue from broken-link report + if: steps.lychee.outputs.exit_code != 0 + uses: peter-evans/create-issue-from-file@v5 + with: + title: Link Checker Report + content-filepath: ./lychee/out.md + labels: | + link-rot + automated