links.yml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # Ultralytics YOLO 🚀, AGPL-3.0 license
  2. # YOLO Continuous Integration (CI) GitHub Actions tests broken link checker
  3. # Accept 429(Instagram, 'too many requests'), 999(LinkedIn, 'unknown status code'), Timeout(Twitter)
  4. name: Check Broken links
  5. on:
  6. workflow_dispatch:
  7. schedule:
  8. - cron: '0 0 * * *' # runs at 00:00 UTC every day
  9. jobs:
  10. Links:
  11. runs-on: ubuntu-latest
  12. steps:
  13. - uses: actions/checkout@v3
  14. - name: Download and install lychee
  15. run: |
  16. 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)
  17. curl -L $LYCHEE_URL -o lychee.tar.gz
  18. tar xzf lychee.tar.gz
  19. sudo mv lychee /usr/local/bin
  20. - name: Test Markdown and HTML links with retry
  21. uses: nick-invision/retry@v2
  22. with:
  23. timeout_minutes: 5
  24. retry_wait_seconds: 60
  25. max_attempts: 3
  26. command: lychee --accept 429,999 --exclude-loopback --exclude 'https?://(www\.)?(linkedin\.com|twitter\.com|instagram\.com|kaggle\.com)' --exclude-path '**/ci.yaml' --exclude-mail --github-token ${{ secrets.GITHUB_TOKEN }} './**/*.md' './**/*.html'
  27. - name: Test Markdown, HTML, YAML, Python and Notebook links with retry
  28. if: github.event_name == 'workflow_dispatch'
  29. uses: nick-invision/retry@v2
  30. with:
  31. timeout_minutes: 5
  32. retry_wait_seconds: 60
  33. max_attempts: 3
  34. command: lychee --accept 429,999 --exclude-loopback --exclude 'https?://(www\.)?(linkedin\.com|twitter\.com|instagram\.com|kaggle\.com|url\.com)' --exclude-path '**/ci.yaml' --exclude-mail --github-token ${{ secrets.GITHUB_TOKEN }} './**/*.md' './**/*.html' './**/*.yml' './**/*.yaml' './**/*.py' './**/*.ipynb'