Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

links.yml 3.5 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
  1. # Ultralytics YOLO 🚀, AGPL-3.0 license
  2. # Continuous Integration (CI) GitHub Actions tests broken link checker using https://github.com/lycheeverse/lychee
  3. # Ignores the following status codes to reduce false positives:
  4. # - 401(Vimeo, 'unauthorized')
  5. # - 403(OpenVINO, 'forbidden')
  6. # - 429(Instagram, 'too many requests')
  7. # - 500(Zenodo, 'cached')
  8. # - 502(Zenodo, 'bad gateway')
  9. # - 999(LinkedIn, 'unknown status code')
  10. name: Check Broken links
  11. on:
  12. workflow_dispatch:
  13. schedule:
  14. - cron: "0 0 * * *" # runs at 00:00 UTC every day
  15. jobs:
  16. Links:
  17. runs-on: ubuntu-latest
  18. steps:
  19. - uses: actions/checkout@v4
  20. - name: Download and install lychee
  21. run: |
  22. LYCHEE_URL=$(curl -s https://api.github.com/repos/lycheeverse/lychee/releases/latest | grep "browser_download_url" | grep "x86_64-unknown-linux-gnu.tar.gz" | cut -d '"' -f 4)
  23. curl -L $LYCHEE_URL -o lychee.tar.gz
  24. tar xzf lychee.tar.gz
  25. sudo mv lychee /usr/local/bin
  26. - name: Test Markdown and HTML links with retry
  27. uses: nick-invision/retry@v3
  28. with:
  29. timeout_minutes: 5
  30. retry_wait_seconds: 60
  31. max_attempts: 3
  32. command: |
  33. lychee \
  34. --scheme https \
  35. --timeout 60 \
  36. --insecure \
  37. --accept 401,403,429,500,502,999 \
  38. --exclude-all-private \
  39. --exclude 'https?://(www\.)?(linkedin\.com|twitter\.com|instagram\.com|kaggle\.com|fonts\.gstatic\.com|url\.com)' \
  40. --exclude-path docs/zh \
  41. --exclude-path docs/es \
  42. --exclude-path docs/ru \
  43. --exclude-path docs/pt \
  44. --exclude-path docs/fr \
  45. --exclude-path docs/de \
  46. --exclude-path docs/ja \
  47. --exclude-path docs/ko \
  48. --exclude-path docs/hi \
  49. --exclude-path docs/ar \
  50. --github-token ${{ secrets.GITHUB_TOKEN }} \
  51. --header "User-Agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.6478.183 Safari/537.36" \
  52. './**/*.md' \
  53. './**/*.html'
  54. - name: Test Markdown, HTML, YAML, Python and Notebook links with retry
  55. if: github.event_name == 'workflow_dispatch'
  56. uses: nick-invision/retry@v3
  57. with:
  58. timeout_minutes: 5
  59. retry_wait_seconds: 60
  60. max_attempts: 3
  61. command: |
  62. lychee \
  63. --scheme https \
  64. --timeout 60 \
  65. --insecure \
  66. --accept 401,403,429,500,502,999 \
  67. --exclude-all-private \
  68. --exclude 'https?://(www\.)?(linkedin\.com|twitter\.com|instagram\.com|kaggle\.com|fonts\.gstatic\.com|url\.com)' \
  69. --exclude-path '**/ci.yaml' \
  70. --exclude-path docs/zh \
  71. --exclude-path docs/es \
  72. --exclude-path docs/ru \
  73. --exclude-path docs/pt \
  74. --exclude-path docs/fr \
  75. --exclude-path docs/de \
  76. --exclude-path docs/ja \
  77. --exclude-path docs/ko \
  78. --exclude-path docs/hi \
  79. --exclude-path docs/ar \
  80. --github-token ${{ secrets.GITHUB_TOKEN }} \
  81. --header "User-Agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.6478.183 Safari/537.36" \
  82. './**/*.md' \
  83. './**/*.html' \
  84. './**/*.yml' \
  85. './**/*.yaml' \
  86. './**/*.py' \
  87. './**/*.ipynb'
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...