DC-5259 Added Lychee Link Checker #31
Workflow file for this run
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: Lychee | |
| on: [pull_request] | |
| jobs: | |
| lychee: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Lychee Link Checker | |
| id: lychee | |
| uses: lycheeverse/lychee-action@v2 | |
| with: | |
| fail: false | |
| output: ../lychee/out.md | |
| args: > | |
| --cache | |
| --max-cache-age 1d | |
| --no-progress | |
| --accept 200,201,204,304,403,429 | |
| --mode emoji | |
| --timeout 20 | |
| --max-retries 3 | |
| --max-concurrency 16 | |
| --exclude 'http://localhost.*' | |
| --exclude 'https://localhost.*' | |
| --exclude 'https://dev.mysql.com/.*' | |
| --exclude 'https://www.mysql.com/.*' | |
| --exclude 'https://www.gnu.org/.*' | |
| --exclude '^/.*' | |
| './**/*.md' './**/*.mdx' './**/*.html' | |
| workingDirectory: "content" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.github_token }} | |
| - name: Format comment | |
| if: always() | |
| run: | | |
| { | |
| echo "## π Link Check Results" | |
| echo "" | |
| echo "<details>" | |
| echo "<summary>View detailed results</summary>" | |
| echo "" | |
| cat lychee/out.md | |
| echo "" | |
| echo "</details>" | |
| } > lychee/out.md | |
| - name: Comment Broken Links | |
| if: always() | |
| uses: peter-evans/create-or-update-comment@v4 | |
| with: | |
| issue-number: ${{ github.event.pull_request.number }} | |
| body-path: lychee/out.md | |
| - name: Fail if broken links found | |
| if: steps.lychee.outputs.exit_code != 0 | |
| run: exit ${{ steps.lychee.outputs.exit_code }} |