Skip to content

Commit fe363a9

Browse files
justin808claude
andauthored
Add retry logic for transient HTTP errors in markdown link checker (#1899)
* Add retry logic for transient HTTP errors in markdown link checker Configure markdown-link-check to retry on transient server errors (500, 502, 503, 504) in addition to rate limit errors (429). This prevents CI failures from flaky external links that temporarily return 502 Bad Gateway or similar intermittent errors. Changes: - Increase retryCount from 3 to 5 for better resilience - Add explicit retry configuration with 10-second delays between attempts - Configure retries for HTTP status codes: 429, 500, 502, 503, 504 This should resolve the flaky test failures where external links like https://github.com/shakacode/react_on_rails_demo_ssr_hmr occasionally return 502 errors. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> * Fix markdown link checker to properly retry on transient errors The previous commit added an invalid 'retry' configuration object that is not supported by markdown-link-check, which only retries on HTTP 429 (rate limiting). This commit implements proper retry logic by: 1. Wrapping the markdown-link-check action with Wandalen/wretry.action 2. Configuring 3 retry attempts with 10-second delays between attempts 3. Removing the unsupported 'retry' configuration object from the JSON config 4. Increasing retryCount to 5 for 429 rate limit handling This approach will retry the entire link check operation when it fails due to transient errors like 502 Bad Gateway, while maintaining the existing 429 retry configuration for rate limiting. Impact on CI time: Each retry adds ~10 seconds, so worst case is +20 seconds for a completely failing run (which would fail anyway without retries). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: Claude <[email protected]>
1 parent 45821a2 commit fe363a9

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

.github/markdown-link-check-config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
],
4242
"timeout": "20s",
4343
"retryOn429": true,
44-
"retryCount": 3,
44+
"retryCount": 5,
4545
"fallbackRetryDelay": "30s",
4646
"aliveStatusCodes": [200, 206]
4747
}

.github/workflows/check-markdown-links.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,18 @@ jobs:
2323
steps:
2424
- uses: actions/checkout@v4
2525

26-
- name: Check markdown links
27-
uses: tcort/github-action-markdown-link-check@a800ad5f1c35bf61987946fd31c15726a1c9f2ba # v1.1.0
26+
- name: Check markdown links (with retry on transient errors)
27+
uses: Wandalen/wretry.action@v3.5.0
2828
with:
29-
use-quiet-mode: 'yes'
30-
use-verbose-mode: 'no'
31-
config-file: '.github/markdown-link-check-config.json'
32-
folder-path: 'docs/'
33-
file-extension: '.md'
34-
max-depth: -1
35-
check-modified-files-only: 'no'
36-
base-branch: 'master'
29+
action: tcort/github-action-markdown-link-check@a800ad5f1c35bf61987946fd31c15726a1c9f2ba
30+
with: |
31+
use-quiet-mode: yes
32+
use-verbose-mode: no
33+
config-file: .github/markdown-link-check-config.json
34+
folder-path: docs/
35+
file-extension: .md
36+
max-depth: -1
37+
check-modified-files-only: no
38+
base-branch: master
39+
attempt_limit: 3
40+
attempt_delay: 10000

0 commit comments

Comments
 (0)