name: docs-lint

on:
  push:
    branches: [main]
    paths:
      - "**/*.md"
      - ".markdownlint.yml"
      - ".markdownlintignore"
      - ".github/workflows/docs-lint.yml"
      - "scripts/docs/docs_lint.sh"
      - "docs/standards/lint_scope.txt"
  pull_request:
    branches: [main]
    paths:
      - "**/*.md"
      - ".markdownlint.yml"
      - ".markdownlintignore"
      - ".github/workflows/docs-lint.yml"
      - "scripts/docs/docs_lint.sh"
      - "docs/standards/lint_scope.txt"

jobs:
  markdownlint:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Setup Node
        uses: actions/setup-node@v4
        with:
          node-version: "20"

      - name: Lint markdown
        run: bash scripts/docs/docs_lint.sh
