mirror of
https://github.com/sveltejs/ai-tools.git
synced 2026-07-07 05:31:03 +08:00
72 lines
2.3 KiB
YAML
72 lines
2.3 KiB
YAML
name: Sync Agents Documentation
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- 'instructions/AGENTS.md'
|
|
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
|
|
jobs:
|
|
sync-agents:
|
|
# prevents this action from running on forks
|
|
if: github.repository == 'sveltejs/mcp'
|
|
name: Sync AGENTS.md to OpenCode Package and Docs
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
|
|
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: Sync AGENTS.md
|
|
run: pnpm sync-agents-md
|
|
|
|
- name: Check for changes
|
|
id: git-check
|
|
run: |
|
|
git diff --exit-code packages/opencode/instructions/opencode-agents.md documentation/docs/10-introduction/.generated/agents.md || echo "changed=true" >> $GITHUB_OUTPUT
|
|
|
|
- name: Create Pull Request
|
|
if: steps.git-check.outputs.changed == 'true'
|
|
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
commit-message: 'chore: sync AGENTS.md to opencode package and documentation'
|
|
branch: chore/sync-agents-md
|
|
delete-branch: true
|
|
title: 'chore: sync AGENTS.md to opencode package and documentation'
|
|
body: |
|
|
## Summary
|
|
Automatically synced AGENTS.md to the opencode package and documentation.
|
|
|
|
This PR was triggered by changes to `instructions/AGENTS.md`.
|
|
|
|
## Changes
|
|
- Synced `packages/opencode/instructions/opencode-agents.md` with latest AGENTS.md
|
|
- Updated `documentation/docs/10-introduction/.generated/agents.md` with latest content
|
|
|
|
## Generated by
|
|
GitHub Action: Sync Agents Documentation
|
|
labels: |
|
|
chore
|
|
documentation
|
|
automated
|