Commit 9ddce37
Harden linkcheck.yml, declare known false positives, pin to v1
Closes #566.
Hardening, as filed
-------------------
The three improvements from #566, already proven in lecture-python-intro
#783:
- `contents: read` in permissions. The block only granted `issues: write`,
and because `permissions:` resets every unlisted scope to none, the
`gh api .../releases/latest` call was running with `contents: none`.
- `set -euo pipefail` and single-asset selection. The old jq emitted one
line per matching asset with nothing to stop an empty or multi-line
result flowing into curl; it now selects the first match and fails with
a clear message when there is none.
- `curl -fsSL` rather than `-sL`, so an HTTP error page is a download
failure rather than a cryptic tar extraction error.
Verified the new jq against this repo's current latest release: it
returns the publish-2026aug03 tarball, same URL as the old form.
Known false positives
---------------------
action-link-checker v1.1.0 adds an `ignore-patterns` input
(QuantEcon/action-link-checker#2, shipped in #3 there). This declares the
same exemptions the repo already keeps in `lectures/_config.yml` under
`linkcheck_ignore`, which Sphinx's built-in checker honours but this
checker never sees -- it scans built HTML, not the Sphinx config. The
regex syntax is identical, so the entries move across unchanged.
FRED is the one that mattered: it throttles datacenter IP ranges, so it
times out from a runner while returning 200 in under half a second from
a normal network. Seventeen duplicate issues were filed for those links
between April and July.
Checked the patterns against the actual published HTML from the current
release, using the shipped v1.1.0 code rather than a reimplementation:
across 33 files and 955 external anchors, 7 anchors match, 6 distinct
URLs, and no FRED link remains checked. The other 948 are unaffected.
Pinning
-------
Moves from `@main` to `@v1`. #566 recorded the decision to stay on
`@main` on the grounds that it is a first-party action, and that holds,
but v1.1.0 shipped a default-on behaviour change (a recurring finding now
refreshes one issue instead of opening a new one weekly) which reached
this repo the moment it merged. `@v1` still takes patches and features
automatically; it just means a future change of that kind is something we
adopt rather than receive.
The other three consumers -- lecture-python-intro,
lecture-python-advanced.myst and continuous_time_mcs -- should move to
`@v1` too, so the series does not end up split across pinning schemes.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 1bb37dd commit 9ddce37
1 file changed
Lines changed: 26 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| 21 | + | |
20 | 22 | | |
21 | | - | |
22 | | - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
23 | 29 | | |
24 | 30 | | |
| 31 | + | |
25 | 32 | | |
26 | | - | |
| 33 | + | |
27 | 34 | | |
28 | | - | |
| 35 | + | |
29 | 36 | | |
30 | 37 | | |
31 | 38 | | |
32 | 39 | | |
33 | 40 | | |
34 | 41 | | |
35 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
0 commit comments