Check external URLs in all files #245
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: Links | |
| on: | |
| repository_dispatch: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 0 * * 1" | |
| jobs: | |
| linkChecker: | |
| if: github.repository == 'pingcap/docs' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Download Exclude Path | |
| run: | | |
| curl https://raw.githubusercontent.com/pingcap/docs/master/.lycheeignore --output .lycheeignore | |
| - name: Restore lychee cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: .lycheecache | |
| key: cache-lychee-${{ github.sha }} | |
| restore-keys: cache-lychee- | |
| - name: Check Links | |
| uses: lycheeverse/lychee-action@v2 | |
| with: | |
| # Don't fail as we want the workflow to continue and run 'Create Issue From File' | |
| # Excluding releases paths as historic releases may have outdated links. | |
| fail: false | |
| failIfEmpty: false | |
| args: --root-dir $(pwd) --cache --max-cache-age 8d -E -i -n -t 45 --exclude-path '^./releases/' --exclude-path '^./tidb-cloud/releases/' --exclude-path '^./resources/' . | |
| output: out.md | |
| env: | |
| GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
| - name: Create Issue From File | |
| uses: peter-evans/create-issue-from-file@v6 | |
| with: | |
| title: Broken Link Detected | |
| content-filepath: out.md | |
| # - name: Fail if there were link errors | |
| # run: exit ${{ steps.lychee.outputs.exit_code }} |