99 name : QuantEcon AI link checking
1010 runs-on : " ubuntu-latest"
1111 permissions :
12+ contents : read # read latest release assets via gh api
1213 issues : write # required for QuantEcon link-checker
1314 steps :
1415 # Download the latest release HTML archive (permanent, not subject to artifact expiry)
@@ -17,19 +18,42 @@ jobs:
1718 env :
1819 GH_TOKEN : ${{ github.token }}
1920 run : |
21+ set -euo pipefail
2022 ASSET_URL=$(gh api repos/${{ github.repository }}/releases/latest \
21- --jq '.assets[] | select(.name | endswith(".tar.gz")) | .browser_download_url')
22- echo "asset-url=$ASSET_URL" >> $GITHUB_OUTPUT
23+ --jq '[.assets[] | select(.name | endswith(".tar.gz")) | .browser_download_url] | first // ""')
24+ if [ -z "$ASSET_URL" ]; then
25+ echo "::error::No .tar.gz asset found on the latest release"
26+ exit 1
27+ fi
28+ echo "asset-url=$ASSET_URL" >> "$GITHUB_OUTPUT"
2329 - name : Download and extract release HTML
2430 run : |
31+ set -euo pipefail
2532 mkdir -p _site
26- curl -sL "${{ steps.release.outputs.asset-url }}" | tar -xz -C _site
33+ curl -fsSL "${{ steps.release.outputs.asset-url }}" | tar -xz -C _site
2734 - name : AI-Powered Link Checker
28- uses : QuantEcon/action-link-checker@main
35+ uses : QuantEcon/action-link-checker@v1
2936 with :
3037 html-path : ' _site'
3138 fail-on-broken : ' false'
3239 silent-codes : ' 403,503'
3340 ai-suggestions : ' true'
3441 create-issue : ' true'
35-
42+ # Known false positives, kept in step with the linkcheck_ignore list in
43+ # lectures/_config.yml. Sphinx's built-in checker reads that list; this
44+ # checker scans the built HTML and never sees it, so the exemptions have
45+ # to be stated in both places. Same regex syntax, so entries move across
46+ # directly -- but the matching differs: Sphinx anchors a pattern at the
47+ # start of the URL, this checker matches anywhere in it. A pattern
48+ # copied here can therefore match more than it does there, never less.
49+ # Update both when adding one, and anchor deliberately if it matters.
50+ ignore-patterns : |
51+ https://github.com/matplotlib/matplotlib/blob/v3.6.2/lib/matplotlib/axes/_axes.py#L1417-L1669
52+ https://ieeexplore.ieee.org/document/8757088
53+ https://www.sciencedirect.com/science/article/pii/S1477388021000177
54+ https://keras.io/
55+ https://data.oecd.org/
56+ https://www.reddit.com/
57+ https://openai.com
58+ https://chatgpt.com/
59+ https://fred.stlouisfed.org/.*
0 commit comments