Check for broken links #152
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Check for broken links | |
| on: | |
| repository_dispatch: | |
| workflow_dispatch: | |
| schedule: | |
| # https://crontab.guru/#00_18_*_*_1 | |
| - cron: "00 18 * * 1" | |
| permissions: | |
| issues: write | |
| jobs: | |
| linkChecker: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Setup Hugo | |
| uses: peaceiris/actions-hugo@v2 | |
| with: | |
| # This should be the same version that we use in .netlify.toml | |
| hugo-version: '0.125.3' | |
| extended: true | |
| - name: Build | |
| run: hugo --minify | |
| - name: Link Checker | |
| uses: lycheeverse/[email protected] | |
| with: | |
| args: | | |
| # fonts.gstatic.com is an expected fail | |
| --exclude https://fonts.gstatic.com | |
| # "%oo many requests" errors | |
| --exclude twitter.com | |
| # 403 Forbidden errors | |
| --exclude https://data8.org | |
| # 403 Forbidden errors | |
| --exclude https://biorxiv.org | |
| --exclude https://www.biorxiv.org | |
| --verbose | |
| --no-progress | |
| public/**/*.html | |
| env: | |
| GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
| - name: Create Issue From File | |
| if: env.lychee_exit_code != 0 | |
| uses: peter-evans/create-issue-from-file@v4 | |
| with: | |
| title: Link Checker Report | |
| content-filepath: ./lychee/out.md | |
| labels: report, automated issue |