DX-2361: Add GitHub Actions to validate external URLs and internal anchor fragments #2
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: Check External Links | |
| on: | |
| pull_request: | |
| workflow_dispatch: | |
| inputs: | |
| timeout: | |
| description: 'Per-request timeout in seconds' | |
| required: false | |
| default: '10' | |
| delay: | |
| description: 'Delay between requests in seconds (rate limiting)' | |
| required: false | |
| default: '0.5' | |
| permissions: | |
| contents: read | |
| jobs: | |
| check-external-links: | |
| name: Check External URLs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@7f4fc3e22c37d6ff65e88745f38bd3157c663f7c # v4 | |
| with: | |
| python-version: '3.9' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade 'pip>=23.0,<25' | |
| pip install 'requests>=2.31.0,<3' | |
| - name: Check external links | |
| env: | |
| TIMEOUT: ${{ github.event.inputs.timeout || '10' }} | |
| DELAY: ${{ github.event.inputs.delay || '0.5' }} | |
| run: | | |
| echo "🌐 Checking external URLs across all MDX files..." | |
| python scripts/validate_mintlify_docs.py . \ | |
| --external-links \ | |
| --external-errors-only \ | |
| --external-timeout "$TIMEOUT" \ | |
| --external-delay "$DELAY" \ | |
| --links-only \ | |
| --verbose | |
| - name: External link check complete | |
| if: success() | |
| run: echo "✅ All external links are reachable." |