Merge pull request #63 from sveltejs/automatic-prompt-sync-with-docs #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update Prompt Documentation | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'packages/mcp-server/src/mcp/handlers/prompts/**' | |
permissions: | |
contents: write | |
pull-requests: write | |
jobs: | |
update-docs: | |
# prevents this action from running on forks | |
if: github.repository == 'sveltejs/mcp' | |
name: Update Prompt Documentation | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v5 | |
with: | |
fetch-depth: 0 | |
- name: Setup Node.js | |
uses: actions/setup-node@v5 | |
with: | |
node-version: 24 | |
package-manager-cache: false # pnpm is not installed yet | |
- name: Install pnpm | |
shell: bash | |
run: | | |
PNPM_VER=$(jq -r '.packageManager | if .[0:5] == "pnpm@" then .[5:] else "packageManager in package.json does not start with pnpm@\n" | halt_error(1) end' package.json) | |
echo installing pnpm version $PNPM_VER | |
npm i -g pnpm@$PNPM_VER | |
- name: Setup Node.js with pnpm cache | |
uses: actions/setup-node@v5 | |
with: | |
node-version: 24 | |
package-manager-cache: true # caches pnpm via packageManager field in package.json | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile --prefer-offline --ignore-scripts | |
- name: Generate prompt documentation | |
run: pnpm generate-prompt-docs | |
- name: Check for changes | |
id: git-check | |
run: | | |
git diff --exit-code documentation/docs/30-capabilities/30-prompts.md || echo "changed=true" >> $GITHUB_OUTPUT | |
- name: Create Pull Request | |
if: steps.git-check.outputs.changed == 'true' | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: 'docs: update prompts documentation' | |
branch: docs/update-prompt-docs | |
delete-branch: true | |
title: 'docs: update prompt documentation' | |
body: | | |
## Summary | |
Automatically generated documentation update for MCP prompts. | |
This PR was triggered by changes to the prompts folder in `packages/mcp-server/src/mcp/handlers/prompts/`. | |
## Changes | |
- Updated `documentation/docs/30-capabilities/30-prompts.md` with latest prompt definitions | |
## Generated by | |
GitHub Action: Update Prompt Documentation | |
labels: | | |
documentation | |
automated |