Skip to content

Commit ee9a7a6

Browse files
authored
Retry markdown link check on failure (#295)
1 parent dd104c0 commit ee9a7a6

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash -e
2+
3+
retry_count=3
4+
5+
for file in "$@"; do
6+
for i in $(seq 1 $retry_count); do
7+
if markdown-link-check --config "$(dirname "$0")/markdown-link-check-config.json" \
8+
"$file"; then
9+
break
10+
elif [[ $i -eq $retry_count ]]; then
11+
exit 1
12+
fi
13+
sleep 5
14+
done
15+
done

.github/workflows/reusable-markdown-link-check.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,4 @@ jobs:
1717
find . -type f \
1818
-name '*.md' \
1919
-not -path './CHANGELOG.md' \
20-
| xargs markdown-link-check \
21-
--config .github/scripts/markdown-link-check-config.json
20+
| xargs .github/scripts/markdown-link-check-with-retry.sh

0 commit comments

Comments
 (0)