From ee340dc954ee3447ab34e7163b31cbb02cf7e721 Mon Sep 17 00:00:00 2001 From: mmcky Date: Tue, 5 Aug 2025 13:00:20 +1000 Subject: [PATCH 1/2] MAINT: update linkchecker to use lychee (weekly) --- .github/workflows/linkcheck.yml | 54 ++++++++++++++------------------- 1 file changed, 22 insertions(+), 32 deletions(-) diff --git a/.github/workflows/linkcheck.yml b/.github/workflows/linkcheck.yml index fd0c1848..e78f90e7 100644 --- a/.github/workflows/linkcheck.yml +++ b/.github/workflows/linkcheck.yml @@ -1,41 +1,31 @@ name: Link Checker [Anaconda, Linux] on: - pull_request: - types: [opened, reopened] + schedule: + # UTC 23:00 is early morning in Australia (9am) every Sunday + - cron: '0 23 * * 0' + workflow_dispatch: jobs: - link-check-linux: - name: Link Checking (${{ matrix.python-version }}, ${{ matrix.os }}) - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: ["ubuntu-latest"] - python-version: ["3.12"] + link-checking: + name: Link Checking + runs-on: "ubuntu-latest" + permissions: + issues: write # required for peter-evans/create-issue-from-file steps: + # Checkout the live site (html) - name: Checkout uses: actions/checkout@v4 - - name: Setup Anaconda - uses: conda-incubator/setup-miniconda@v3 with: - auto-update-conda: true - auto-activate-base: true - miniconda-version: 'latest' - python-version: "3.12" - environment-file: environment.yml - activate-environment: quantecon - - name: Download "build" folder (cache) - uses: dawidd6/action-download-artifact@v11 - with: - workflow: cache.yml - branch: main - name: build-cache - path: _build + ref: gh-pages - name: Link Checker - shell: bash -l {0} - run: jb build lectures --path-output=./ --builder=custom --custom-builder=linkcheck - - name: Upload Link Checker Reports - uses: actions/upload-artifact@v4 - if: failure() + id: lychee + uses: lycheeverse/lychee-action@v2 + with: + fail: false + args: --accept 403,503 *.html + - name: Create Issue From File + if: steps.lychee.outputs.exit_code != 0 + uses: peter-evans/create-issue-from-file@v5 with: - name: linkcheck-reports - path: _build/linkcheck \ No newline at end of file + title: Link Checker Report + content-filepath: ./lychee/out.md + labels: report, automated issue, linkchecker \ No newline at end of file From 04fcdad3891d02b52669b1da5ab904971d1922d6 Mon Sep 17 00:00:00 2001 From: Matt McKay Date: Tue, 5 Aug 2025 13:06:09 +1000 Subject: [PATCH 2/2] Update .github/workflows/linkcheck.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/linkcheck.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linkcheck.yml b/.github/workflows/linkcheck.yml index e78f90e7..01cd8cae 100644 --- a/.github/workflows/linkcheck.yml +++ b/.github/workflows/linkcheck.yml @@ -21,7 +21,7 @@ jobs: uses: lycheeverse/lychee-action@v2 with: fail: false - args: --accept 403,503 *.html + args: --accept 403,503 **/*.html - name: Create Issue From File if: steps.lychee.outputs.exit_code != 0 uses: peter-evans/create-issue-from-file@v5