Link Checker [Anaconda, Linux] #1221
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Link Checker [Anaconda, Linux] | |
| on: | |
| schedule: | |
| # UTC 23:00 is early morning in Australia (9am) | |
| - cron: '0 23 * * 1' | |
| workflow_dispatch: | |
| jobs: | |
| link-checking: | |
| name: QuantEcon AI link checking | |
| runs-on: "ubuntu-latest" | |
| permissions: | |
| contents: read # read latest release assets via gh api | |
| issues: write # required for QuantEcon link-checker | |
| steps: | |
| # Download the latest release HTML archive (permanent, not subject to artifact expiry) | |
| - name: Get latest release asset URL | |
| id: release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| set -euo pipefail | |
| ASSET_URL=$(gh api repos/${{ github.repository }}/releases/latest \ | |
| --jq '[.assets[] | select(.name | endswith(".tar.gz")) | .browser_download_url] | first // ""') | |
| if [ -z "$ASSET_URL" ]; then | |
| echo "::error::No .tar.gz asset found on the latest release" | |
| exit 1 | |
| fi | |
| echo "asset-url=$ASSET_URL" >> "$GITHUB_OUTPUT" | |
| - name: Download and extract release HTML | |
| run: | | |
| set -euo pipefail | |
| mkdir -p _site | |
| curl -fsSL "${{ steps.release.outputs.asset-url }}" | tar -xz -C _site | |
| - name: AI-Powered Link Checker | |
| uses: QuantEcon/action-link-checker@v1 | |
| with: | |
| html-path: '_site' | |
| fail-on-broken: 'false' | |
| silent-codes: '403,503' | |
| ai-suggestions: 'true' | |
| create-issue: 'true' | |
| # Known false positives, kept in step with the linkcheck_ignore list in | |
| # lectures/_config.yml. Sphinx's built-in checker reads that list; this | |
| # checker scans the built HTML and never sees it, so the exemptions have | |
| # to be stated in both places. Same regex syntax, so entries move across | |
| # directly -- but the matching differs: Sphinx anchors a pattern at the | |
| # start of the URL, this checker matches anywhere in it. A pattern | |
| # copied here can therefore match more than it does there, never less. | |
| # Update both when adding one, and anchor deliberately if it matters. | |
| ignore-patterns: | | |
| https://github.com/matplotlib/matplotlib/blob/v3.6.2/lib/matplotlib/axes/_axes.py#L1417-L1669 | |
| https://ieeexplore.ieee.org/document/8757088 | |
| https://www.sciencedirect.com/science/article/pii/S1477388021000177 | |
| https://keras.io/ | |
| https://data.oecd.org/ | |
| https://www.reddit.com/ | |
| https://openai.com | |
| https://chatgpt.com/ | |
| https://fred.stlouisfed.org/.* |