Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/apidocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Generate & Publish API Docs

on:
push:
branches: [ main ]
paths:
- 'src/routes/**'
- 'apidoc.json'

jobs:
docs:
runs-on: ubuntu-latest
steps:
Comment on lines +10 to +13
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Workflow will fail to push without explicit write permissions

peaceiris/actions-gh-pages needs contents: write on the GITHUB_TOKEN.
GitHub Actions now defaults tokens to read-only; the deploy step will error with Permission denied (publickey) or remote: Permission to … denied.

Add explicit permissions:

 jobs:
   docs:
+    permissions:
+      contents: write   # allow push to gh-pages
     runs-on: ubuntu-latest
🤖 Prompt for AI Agents
In .github/workflows/apidocs.yml around lines 10 to 13, the GitHub Actions
workflow lacks explicit write permissions for the GITHUB_TOKEN, causing the
deploy step using peaceiris/actions-gh-pages to fail with permission errors. Add
a permissions section to the workflow specifying 'contents: write' to grant the
necessary write access for pushing changes.

- uses: actions/checkout@v4

- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install apidoc with Bun
run: bun install --no-save apidoc

- name: Generate docs
run: bunx apidoc -c apidoc.json -o docs/apidoc

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/apidoc