# TODO: doesn't handle `::: warning` blocks
# TODO: doesn't handle links to other files

name: Update vimdocs

on:
  push:
    branches: [main]
    paths:
      - doc/**
      - .github/workflows/panvimdoc.yaml

permissions:
  contents: write

jobs:
  docs:
    if: github.repository == 'Saghen/blink.cmp'
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: kdheepak/panvimdoc@main
        with:
          vimdoc: blink-cmp
          pandoc: doc/vimdoc.md
          version: NVIM v0.10.0
          shiftheadinglevelby: 0
          incrementheadinglevelby: 0
      - uses: stefanzweifel/git-auto-commit-action@v5
        with:
          commit_message: "docs: update vimdocs"
          branch: ${{ github.head_ref }}
