name: Markdown

on:
  pull_request:
    paths:
      - "*.md"
      - "**/*.md"
  push:
    paths:
      - "*.md"
      - "**/*.md"

permissions:
  contents: "read"

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

jobs:
  markdownlint:
    name: Lint markdown files
    runs-on: ubuntu-latest
    timeout-minutes: 1
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
      - name: Configure Ruby
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: '3.2'
          bundler-cache: true
      - name: Install markdownlint
        run: gem install mdl
      - name: Check markdown files
        run: mdl --git-recurse .
