Link check #183
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: Link check | |
| # yamllint disable-line rule:truthy | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| paths: | |
| - 'README.md' | |
| - 'lychee.toml' | |
| - '.github/workflows/links.yaml' | |
| schedule: | |
| - cron: '0 6 * * 1' # Mondays at 06:00 UTC | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| issues: write | |
| jobs: | |
| links: | |
| name: Lychee link check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out code from GitHub | |
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: Restore lychee cache | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: .lycheecache | |
| key: cache-lychee-${{ github.sha }} | |
| restore-keys: cache-lychee- | |
| - name: Run lychee | |
| id: lychee | |
| uses: lycheeverse/lychee-action@e7477775783ea5526144ba13e8db5eec57747ce8 # v2.9.0 | |
| with: | |
| args: --config lychee.toml README.md | |
| fail: ${{ github.event_name != 'schedule' }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create issue from scheduled-run failure | |
| if: github.event_name == 'schedule' && steps.lychee.outputs.exit_code != 0 | |
| uses: peter-evans/create-issue-from-file@fca9117c27cdc29c6c4db3b86c48e4115a786710 # v6.0.0 | |
| with: | |
| title: 'Link check report' | |
| content-filepath: ./lychee/out.md | |
| labels: 'link-check' |