Check links #428
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
| # Checks if all links are valid, i.e. not broken | |
| # | |
| # Errors are reported via an Issue being created, | |
| # instead of via en email to all repository Watchers | |
| name: Check links | |
| # Only run this on the main branch, or with Pull Requests | |
| on: | |
| schedule: | |
| - cron: "0 9-21/3 * * *" | |
| workflow_dispatch: | |
| jobs: | |
| check_links: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Remove folders that need not to be checked | |
| run: | | |
| rm -rf docs/*/not_used/ | |
| rm -rf docs/*/may2024/ | |
| rm -rf docs/May23 | |
| rm -rf docs/May_24 | |
| rm -rf docs/feb23_course | |
| rm -rf docs/mermaid | |
| - name: Restore lychee cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: .lycheecache | |
| key: cache-lychee-${{ github.sha }} | |
| restore-keys: cache-lychee- | |
| #- name: Check RST files | |
| # id: lychee | |
| # uses: lycheeverse/lychee-action@v1.10.0 | |
| # with: | |
| # # Check all reStructuredText files in repo | |
| # args: --base docs/ --max-redirects 10 --user-agent "curl/8.4.0" --verbose --no-progress './**/*.rst' | |
| - name: Check MD files | |
| uses: gaurav-nelson/github-action-markdown-link-check@v1 | |
| with: | |
| config-file: 'mlc_config.json' | |
| use-quiet-mode: 'yes' | |
| use-verbose-mode: 'no' | |
| - name: Create Issue From File | |
| if: env.lychee_exit_code != 0 | |
| uses: peter-evans/create-issue-from-file@v5 | |
| with: | |
| title: Link Checker Report | |
| content-filepath: ./lychee/out.md | |
| labels: report, automated issue |