Link Checker [Anaconda, Linux] #1711
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) -- runs weekly on Sunday | |
| - cron: '0 23 * * 0' | |
| 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 -xzf - -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. The first three mirror the linkcheck_ignore | |
| # list in lectures/_config.yml, which Sphinx reads and this checker | |
| # cannot see; keep the two in step. FRED throttles datacenter IP | |
| # ranges, so it times out from a runner while serving readers fine. | |
| ignore-patterns: | | |
| https://doi\.org/https://doi\.org/10\.2307/1235116 | |
| https://math\.stackexchange\.com/ | |
| https://stackoverflow\.com/ | |
| https://fred\.stlouisfed\.org |