Step 2: Gate pull requests in GitHub Actions with SARIF annotations

Wiring the check into a `pull_request` workflow and passing `--format sarif` output to GitHub Code Scanning surfaces broken links inline on the pull request diff with line-level fingerprints.

Keeping PR checks strictly offline while delegating `--external` URL sweeps to a nightly schedule gives you sub-second deterministic pull request feedback with zero network flakiness.

yaml
name: Markdown Link Check
on:
  pull_request:
    paths:
      - "**/*.md"
      - "docs/**"
jobs:
  links:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-python@v5
        with:
          python-version: "3.12"
      - run: pip install deadlinkfinder && deadlinkfinder check .
      - name: Generate SARIF report
        if: always()
        run: deadlinkfinder check . --format sarif > links.sarif
        continue-on-error: true

Source: DeadLinkFinder project page and architecture notes

Source: PyPI: deadlinkfinder package

Source: GitHub: umutgungorr/deadlinkfinder

Source: Designing CLI Tools That Earn Trust