Skip to content

Commit 95c9fda

Browse files
committed
ci: update generate-docs.yml
1 parent 14e56b2 commit 95c9fda

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

.github/workflows/generate-docs.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,21 @@ jobs:
7575
run: |
7676
set -euo pipefail
7777
78-
output_dir="docs/src/${REPO_NAME}"
78+
output_dir="docs/src/${REPO_NAME}/api"
7979
mkdir -p "$output_dir"
80-
find "$output_dir" -maxdepth 1 -type f -name "*.md" ! -name "index.md" -delete
80+
find "$output_dir" -maxdepth 1 -type f -name "*.md" -delete
8181
82-
luajit scripts/generate-api-docs.lua "${RUNNER_TEMP}/source/types" "$output_dir"
82+
luajit scripts/generate-api-docs.lua "${RUNNER_TEMP}/source/types" "$output_dir" "$REPO_NAME"
8383
env:
8484
REPO_NAME: ${{ matrix.repo.name }}
8585

8686
- name: Format docs
87-
run: npx --yes prettier@3.8.3 --write "docs/src/${REPO_NAME}/*.md"
87+
run: |
88+
set -euo pipefail
89+
90+
if compgen -G "docs/src/${REPO_NAME}/api/*.md" > /dev/null; then
91+
npx --yes prettier@3.8.3 --write "docs/src/${REPO_NAME}/api/*.md"
92+
fi
8893
env:
8994
REPO_NAME: ${{ matrix.repo.name }}
9095

@@ -96,4 +101,4 @@ jobs:
96101
body: "Generate and format API docs from `${{ matrix.repo.name }}` LuaLS type annotations."
97102
branch: "automation/generate-docs-${{ matrix.repo.name }}"
98103
add-paths: |
99-
docs/src/${{ matrix.repo.name }}
104+
docs/src/${{ matrix.repo.name }}/api

0 commit comments

Comments
 (0)