Link Checker [Anaconda, Linux] #1703
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 -xz -C _site | |
| - name: AI-Powered Link Checker | |
| uses: QuantEcon/action-link-checker@main | |
| with: | |
| html-path: '_site' | |
| fail-on-broken: 'false' | |
| silent-codes: '403,503' | |
| ai-suggestions: 'true' | |
| create-issue: 'true' |