Skip to content

Commit 51477f3

Browse files
mmckyCopilot
andauthored
MAINT: update linkchecker to use lychee (weekly) (#220)
* MAINT: update linkchecker to use lychee (weekly) * Update .github/workflows/linkcheck.yml Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
1 parent 4d02fd3 commit 51477f3

File tree

1 file changed

+22
-32
lines changed

1 file changed

+22
-32
lines changed

.github/workflows/linkcheck.yml

Lines changed: 22 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,31 @@
11
name: Link Checker [Anaconda, Linux]
22
on:
3-
pull_request:
4-
types: [opened, reopened]
3+
schedule:
4+
# UTC 23:00 is early morning in Australia (9am) every Sunday
5+
- cron: '0 23 * * 0'
6+
workflow_dispatch:
57
jobs:
6-
link-check-linux:
7-
name: Link Checking (${{ matrix.python-version }}, ${{ matrix.os }})
8-
runs-on: ${{ matrix.os }}
9-
strategy:
10-
fail-fast: false
11-
matrix:
12-
os: ["ubuntu-latest"]
13-
python-version: ["3.12"]
8+
link-checking:
9+
name: Link Checking
10+
runs-on: "ubuntu-latest"
11+
permissions:
12+
issues: write # required for peter-evans/create-issue-from-file
1413
steps:
14+
# Checkout the live site (html)
1515
- name: Checkout
1616
uses: actions/checkout@v4
17-
- name: Setup Anaconda
18-
uses: conda-incubator/setup-miniconda@v3
1917
with:
20-
auto-update-conda: true
21-
auto-activate-base: true
22-
miniconda-version: 'latest'
23-
python-version: "3.12"
24-
environment-file: environment.yml
25-
activate-environment: quantecon
26-
- name: Download "build" folder (cache)
27-
uses: dawidd6/action-download-artifact@v11
28-
with:
29-
workflow: cache.yml
30-
branch: main
31-
name: build-cache
32-
path: _build
18+
ref: gh-pages
3319
- name: Link Checker
34-
shell: bash -l {0}
35-
run: jb build lectures --path-output=./ --builder=custom --custom-builder=linkcheck
36-
- name: Upload Link Checker Reports
37-
uses: actions/upload-artifact@v4
38-
if: failure()
20+
id: lychee
21+
uses: lycheeverse/lychee-action@v2
22+
with:
23+
fail: false
24+
args: --accept 403,503 **/*.html
25+
- name: Create Issue From File
26+
if: steps.lychee.outputs.exit_code != 0
27+
uses: peter-evans/create-issue-from-file@v5
3928
with:
40-
name: linkcheck-reports
41-
path: _build/linkcheck
29+
title: Link Checker Report
30+
content-filepath: ./lychee/out.md
31+
labels: report, automated issue, linkchecker

0 commit comments

Comments
 (0)