diff --git a/.docdrift.yaml b/.docdrift.yaml new file mode 100644 index 0000000..0220d4f --- /dev/null +++ b/.docdrift.yaml @@ -0,0 +1,43 @@ +# doc-drift-checker configuration. Reports README sections whose linked code +# changed while the section itself did not. Sections are linked to code through +# the file paths and relative links the docs mention. +docs: + - "README.md" + - "docs/*.md" + +# A present `ignore` key replaces the built-in defaults, so they are repeated +# here. Release notes, the license and contribution guidelines are +# documentation, not code the README describes. +ignore: + # tests + - "**/*_test.go" + - "**/*.test.*" + - "**/*.spec.*" + - "**/test/**" + - "**/tests/**" + - "**/__tests__/**" + - "**/testdata/**" + # generated code + - "**/*.pb.go" + - "**/*_gen.go" + - "**/*.generated.*" + - "**/generated/**" + - "**/*.min.js" + # lockfiles + - "**/go.sum" + - "**/package-lock.json" + - "**/yarn.lock" + - "**/pnpm-lock.yaml" + - "**/composer.lock" + - "**/Cargo.lock" + - "**/Gemfile.lock" + - "**/poetry.lock" + - "**/uv.lock" + # vendored code + - "**/vendor/**" + - "**/node_modules/**" + - "**/third_party/**" + # release notes, license, contribution guidelines + - "CHANGELOG.md" + - "LICENSE" + - "CONTRIBUTING.md" diff --git a/.github/workflows/docs-drift.yml b/.github/workflows/docs-drift.yml new file mode 100644 index 0000000..31464c5 --- /dev/null +++ b/.github/workflows/docs-drift.yml @@ -0,0 +1,28 @@ +name: Docs drift + +on: + pull_request: + +permissions: + contents: read + +jobs: + docs-drift: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + fetch-depth: 0 + - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 + with: + go-version: stable + cache: false + - name: Install doc-drift-checker + run: | + GOBIN="$RUNNER_TEMP/bin" go install github.com/JtheGunner/doc-drift-checker/cmd/doc-drift-checker@v0.2.3 + - name: Check documentation drift + env: + BASE_REF: ${{ github.base_ref }} + run: | + git fetch --no-tags origin "+refs/heads/${BASE_REF}:refs/remotes/origin/${BASE_REF}" + "$RUNNER_TEMP/bin/doc-drift-checker" check --base "origin/${BASE_REF}" --format github --warn-only