aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows/api-docs.yml
blob: f083d32fcef04a4c737d0040184e6acc027e1558 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# Check if any PR needs to run the autogenerate script
name: Autogenerate API docs
on:
  pull_request:
    paths:
      - 'src/nvim/api/*.[ch]'
      - 'runtime/lua/**.lua'
      - 'runtime/doc/**'

jobs:
  regen-api-docs:
    runs-on: ubuntu-latest
    permissions:
      contents: write
      pull-requests: write
    steps:
      - uses: rhysd/action-setup-vim@v1
        with:
          neovim: true
          version: nightly
      - uses: actions/checkout@v3
      - name: Install dependencies
        run: |
          sudo apt-get update
          sudo env DEBIAN_FRONTEND=noninteractive apt-get install -y doxygen python3 python3-msgpack

      - name: Generate docs
        id: docs
        run: |
          python3 scripts/gen_vimdoc.py
          printf 'UPDATED_DOCS=%s\n' $([ -z "$(git diff)" ]; echo $?) >> $GITHUB_OUTPUT

      - name: FAIL, PR has not committed doc changes
        if: ${{ steps.docs.outputs.UPDATED_DOCS != 0 }}
        run: |
          echo "Job failed, run ./scripts/gen_vimdoc.py and commit your doc changes"
          echo "The doc generation produces the following changes:"
          git diff --color --exit-code