Skip to content

v1.1.0 — ignore-patterns, issue reuse, and the unreachable timeout path

Latest

Choose a tag to compare

@mmcky mmcky released this 03 Aug 06:14
39255b1

First published release of this action. It adds two inputs aimed at the same problem — a link checker whose reports had become noise — and fixes the bugs underneath that made the existing false-positive handling unreachable.

Pin it as QuantEcon/action-link-checker@v1, which now exists as a moving tag and will follow the 1.x line.

ignore-patterns

A newline-separated list of regular expressions for URLs to skip entirely:

- uses: QuantEcon/action-link-checker@v1
  with:
    html-path: '_build/html'
    ignore-patterns: |
      https://fred\.stlouisfed\.org/.*
      linkedin\.com

Matching URLs are never requested, so they can be reported as neither broken nor redirected — an explicit exemption rather than a suppressed finding. They are counted separately and exposed as a new ignored-count output, so an exemption stays visible instead of silently shrinking the scanned set.

Newline-separated rather than comma-separated so that quantifiers such as {1,3} survive unsplit, and matched with re.search, so a bare domain works as a substring without anchoring and a Sphinx linkcheck_ignore list can be pasted in almost unchanged. Note that Sphinx anchors its patterns at the start of the URL while this matches anywhere, so an imported pattern may match slightly more here.

update-existing-issue

Defaults to true. Before creating an issue, the action looks for the newest open issue with the same title and the broken-links label and refreshes its body instead of opening a duplicate. A weekly cron on a persistent finding now produces one issue rather than one per week. Close it once the links are fixed and a recurrence opens a fresh one. A new issue-updated output reports which path was taken.

This is a behaviour change for anyone already running create-issue: 'true'. Set update-existing-issue: 'false' to restore the previous behaviour. Note that GitHub does not send notifications for an edit to an issue body, so a refreshed report is quiet by design — watch the scheduled workflow if you want to be told about every run. If a repository runs more than one link check, give each workflow its own issue-title, or they will overwrite each other's report.

Fixes

is_likely_bot_blocked() exists to absorb exactly the class of false positive above, but it could never fire on a timeout. The legitimate_domains allowance required the error string Connection Error while the timeout handler passed timeout, so a listed domain was protected against one failure mode and reported broken on the other. silent-codes was only consulted on responses that carried a status code, so it could not apply to a timeout or a connection error either. Both are fixed, and the allowance is now keyed on which handler caught the failure rather than on the error text.

Status 0 can now be listed in silent-codes, but only for genuine transport failures — timeout, connection failure, or a response broken mid-stream. A malformed link such as https:// and a redirect loop also report status 0 and stay reported however silent-codes is set, since those are the project's own to fix.

Several fail-quiet paths are also closed. An invalid ignore pattern could abort the whole run rather than be skipped as documented, because re.compile raises OverflowError and RecursionError in addition to re.error. The checker's stderr was written to a file that was never displayed, so none of its warnings could reach a job log. A crash aborted the step with no diagnostic at all. Multi-line outputs used a fixed EOF delimiter that scanned link text could terminate early.

Testing

The test suite previously could not fail — the runner never inspected its result — and one of its two files could not even import the module under test. Both are fixed and both now run in CI, and the fixtures no longer depend on httpstat.us or httpbin.org, which had stopped answering and left the CI step named for silent-codes exercising nothing.

A note on v1.0.0

The v1.0.0 tag points at this repository's initial commit and no release was ever published for it. It is left where it is rather than moved. Pin v1 or v1.1.0.

Full changelog: https://github.com/QuantEcon/action-link-checker/blob/v1.1.0/CHANGELOG.md