Skip to content

Commit 68c117a

Browse files
committed
adding lychee cron monthly or manually run
1 parent 2626732 commit 68c117a

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

.github/workflows/lychee-cron.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Check Links In Public Directory
2+
3+
on:
4+
pull_request:
5+
schedule:
6+
- cron: "0 0 1 * *" # Monthly run on the 1st day of every month at midnight UTC
7+
workflow_dispatch:
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
check-links:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Clone repository
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
ref: dev
23+
24+
- name: Check links in /public
25+
uses: lycheeverse/lychee-action@v2
26+
with:
27+
args: |
28+
public/
29+
--quiet
30+
--max-retries 1
31+
--accept 200,429,403
32+
--exclude-all-private
33+
--exclude '^file://'
34+
--exclude "ethereum\.org"
35+
--include '^https?://'
36+
--format detailed
37+
'./**/*.md'
38+
'./**/*.html'
39+
output: ./lychee-report.txt
40+
continue-on-error: true
41+
42+
# looks like we dont need to do this?
43+
# - name: Add Lychee Report to Job Summary
44+
# if: always()
45+
# run: |
46+
# echo "### Lychee Report" >> $GITHUB_STEP_SUMMARY
47+
# echo '```' >> $GITHUB_STEP_SUMMARY
48+
# cat ./lychee-report.txt >> $GITHUB_STEP_SUMMARY
49+
# echo '```' >> $GITHUB_STEP_SUMMARY
50+
51+
- name: Provide helpful failure message
52+
if: failure()
53+
run: |
54+
echo "::error::Link check failed! Please review the broken links reported above."
55+
echo ""
56+
echo "If certain links are valid but fail due to:"
57+
echo "- CAPTCHA challenges"
58+
echo "- IP blocking"
59+
echo "- Authentication requirements"
60+
echo "- Rate limiting"
61+
echo ""
62+
echo "Consider adding them to .lycheeignore to bypass future checks."
63+
echo "Format: Add one URL pattern per line"
64+
exit 1

0 commit comments

Comments
 (0)