Skip to content

Commit f8a3e85

Browse files
committed
Merge remote-tracking branch 'origin/main' into jb2-update
2 parents 9a78294 + 8dd1c0a commit f8a3e85

2 files changed

Lines changed: 43 additions & 5 deletions

File tree

.github/workflows/linkcheck.yml

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ jobs:
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/.*

lectures/_config.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,20 @@ sphinx:
3535
html_theme: quantecon_book_theme
3636
html_static_path: ['_static']
3737
html_theme_options:
38+
languages:
39+
- code: en
40+
name: English
41+
url: https://python-programming.quantecon.org
42+
- code: fa
43+
name: فارسی
44+
url: https://quantecon.github.io/lecture-python-programming.fa
45+
- code: fr
46+
name: Français
47+
url: https://quantecon.github.io/lecture-python-programming.fr
48+
- code: zh-cn
49+
name: 中文
50+
url: https://quantecon.github.io/lecture-python-programming.zh-cn
51+
current_language: en
3852
authors:
3953
- name: Thomas J. Sargent
4054
url: http://www.tomsargent.com/

0 commit comments

Comments
 (0)