CI Integration
GitHub Actions
Section titled “GitHub Actions”Using the Built-in Action
Section titled “Using the Built-in Action”name: Validate Documentationon: [push, pull_request]jobs: validate: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: LarsArtmann/md-go-validator@v1 with: path: . args: "-f json"Manual Installation
Section titled “Manual Installation”name: Validate Documentationon: [push, pull_request]jobs: validate: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 - run: go install github.com/larsartmann/md-go-validator@latest - run: md-go-validator .SARIF + GitHub Code Scanning
Section titled “SARIF + GitHub Code Scanning”Generate SARIF output and upload to GitHub Code Scanning for inline annotations:
jobs: validate: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 - run: go install github.com/larsartmann/md-go-validator@latest - run: md-go-validator -f sarif -o results.sarif . - uses: github/codeql-action/upload-sarif@v3 with: sarif_file: results.sarifPre-commit Hook
Section titled “Pre-commit Hook”Add to your .pre-commit-config.yaml:
repos: - repo: https://github.com/LarsArtmann/md-go-validator rev: v1.0.0 hooks: - id: md-go-validator args: ["-l", "go"]Baseline Workflow
Section titled “Baseline Workflow”For incremental adoption, use baseline mode in CI:
- run: md-go-validator --save-baseline baseline.txt . if: ${{ github.event_name == 'workflow_dispatch' }}
- run: md-go-validator --baseline baseline.txt .Docker
Section titled “Docker”The GitHub Action uses a Docker image. You can also run it directly:
docker run --rm -v $(pwd):/repo LarsArtmann/md-go-validator:latest .See Also
Section titled “See Also”- Output Formats for JSON and SARIF details
- Baseline Mode for incremental adoption