name: Markdown
on:
  push:
    branches:
      - master
    paths:
      - "**.md"
      - .github/workflows/markdown.yml
  pull_request:
    paths:
      - "**.md"
      - .github/workflows/markdown.yml

jobs:
  markdown:
    runs-on: ubuntu-latest
    permissions:
      actions: read
      contents: read
    steps:
      - uses: actions/checkout@v5

      - uses: DavidAnson/markdownlint-cli2-action@v20
        with:
          globs: "**.md"
          config: .markdownlint-cli2.jsonc

      - uses: reviewdog/action-misspell@v1
        with:
          locale: "US"
          level: error
          pattern: |
            *.md

      - uses: gaurav-nelson/github-action-markdown-link-check@v1
        with:
          use-quiet-mode: yes
          config-file: .github/workflows/configs/mlc-config.json

      - uses: peter-evans/dockerhub-description@v4
        if: github.repository == 'qdm12/gluetun' && github.event_name == 'push'
        with:
          username: qmcgaw
          password: ${{ secrets.DOCKERHUB_PASSWORD }}
          repository: qmcgaw/gluetun
          short-description: Lightweight Swiss-knife VPN client to connect to several VPN providers
          readme-filepath: README.md
