This repository was archived by the owner on May 15, 2026. It is now read-only.
Repository navigation
Link checker #1019
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 checker | |
| on: | |
| pull_request: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 12 * * *' | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| link-check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Install playwright browsers | |
| run: bunx playwright install | |
| - name: Run crawler | |
| id: crawler | |
| continue-on-error: true | |
| run: | | |
| if [[ "${{ github.event_name }}" == "pull_request" ]]; then | |
| echo "Running PR workflow: Building and starting local server..." | |
| bun run build | |
| sleep 5 | |
| bun run start & | |
| sleep 15 | |
| export BASE_URL="http://localhost:3000" | |
| else | |
| export BASE_URL="https://www.docs.sei.io/" | |
| fi | |
| echo "Running link checker for ${BASE_URL}" | |
| bun scripts/checkLinks.ts | |
| - name: Upload broken links artifact | |
| if: steps.crawler.outcome == 'failure' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: broken-links | |
| path: brokenLinks.json | |
| - name: Fail job if crawler finds broken links | |
| if: steps.crawler.outcome == 'failure' | |
| run: exit 1 |