name: Markdown linting

on:
  pull_request:
    branches: [ "master" ]
    paths:
      - '**/*.md'

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  build:
    if: '! github.event.pull_request.draft'
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v1
        with:
          node-version: '20'
      - name: Install Markdownlint CLI
        run: npm install -g markdownlint-cli
      - name: Run Markdownlint
        run: markdownlint -c markdownlint-config.json "**/*.md"
