mirror of
https://github.com/firecrawl/cli.git
synced 2026-09-14 17:30:55 +08:00
70 lines
2.3 KiB
YAML
70 lines
2.3 KiB
YAML
name: Sync to Claude Plugin
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- '.claude-plugin/plugin.json'
|
|
|
|
jobs:
|
|
sync:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout CLI repo
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 2
|
|
path: cli
|
|
|
|
- name: Check if version changed
|
|
id: version
|
|
run: |
|
|
cd cli
|
|
OLD=$(git show HEAD~1:.claude-plugin/plugin.json 2>/dev/null | jq -r '.version' 2>/dev/null || echo "")
|
|
NEW=$(jq -r '.version' .claude-plugin/plugin.json)
|
|
if [ "$OLD" = "$NEW" ]; then
|
|
echo "Version unchanged ($NEW), skipping sync"
|
|
echo "changed=false" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "Version changed: $OLD -> $NEW"
|
|
echo "changed=true" >> $GITHUB_OUTPUT
|
|
echo "version=$NEW" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
- name: Checkout Plugin repo
|
|
if: steps.version.outputs.changed == 'true'
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: firecrawl/firecrawl-claude-plugin
|
|
token: ${{ secrets.FIRECRAWL_SKILLS_SYNC }}
|
|
path: plugin
|
|
|
|
- name: Copy plugin config
|
|
if: steps.version.outputs.changed == 'true'
|
|
env:
|
|
GH_TOKEN: ${{ secrets.FIRECRAWL_SKILLS_SYNC }}
|
|
run: |
|
|
cd plugin
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
|
|
mkdir -p .claude-plugin
|
|
cp ../cli/.claude-plugin/plugin.json .claude-plugin/plugin.json
|
|
cp ../cli/.claude-plugin/marketplace.json .claude-plugin/marketplace.json
|
|
git add -A
|
|
if git diff --cached --quiet; then
|
|
echo "No changes to sync"
|
|
exit 0
|
|
fi
|
|
VERSION="${{ steps.version.outputs.version }}"
|
|
BRANCH="sync/cli-v${VERSION}"
|
|
git checkout -b "$BRANCH"
|
|
git commit -m "Sync from firecrawl/cli - v${VERSION}"
|
|
git push origin "$BRANCH"
|
|
gh pr create \
|
|
--repo firecrawl/firecrawl-claude-plugin \
|
|
--title "Sync CLI changes -> v${VERSION}" \
|
|
--body "Automated sync from [firecrawl/cli](https://github.com/firecrawl/cli) main branch (v${VERSION})." \
|
|
--base main \
|
|
--head "$BRANCH"
|