mirror of
https://github.com/firecrawl/cli.git
synced 2026-09-14 17:30:55 +08:00
76 lines
2.7 KiB
YAML
76 lines
2.7 KiB
YAML
name: Sync to Claude Plugin
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- 'skills/**'
|
|
- '.claude-plugin/**'
|
|
- '.github/workflows/sync-plugin.yml'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
sync:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout CLI repo
|
|
uses: actions/checkout@v6
|
|
with:
|
|
path: cli
|
|
|
|
- name: Clone target repo
|
|
env:
|
|
TOKEN: ${{ secrets.FIRECRAWL_SKILLS_SYNC }}
|
|
run: |
|
|
git clone https://x-access-token:${TOKEN}@github.com/firecrawl/firecrawl-claude-plugin.git plugin 2>/dev/null || {
|
|
mkdir plugin && cd plugin && git init
|
|
git remote add origin https://x-access-token:${TOKEN}@github.com/firecrawl/firecrawl-claude-plugin.git
|
|
}
|
|
|
|
- name: Sync Claude plugin files
|
|
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"
|
|
|
|
rm -rf skills
|
|
mkdir -p skills
|
|
cp -R ../cli/skills/. skills/
|
|
|
|
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
|
|
|
|
SHORT_SHA="${GITHUB_SHA:0:7}"
|
|
COMMIT_URL="https://github.com/${GITHUB_REPOSITORY}/commit/${GITHUB_SHA}"
|
|
|
|
if ! git rev-parse HEAD >/dev/null 2>&1; then
|
|
git checkout -b main
|
|
git commit -m "sync Claude plugin skills from firecrawl/cli (${SHORT_SHA})"
|
|
git push origin main
|
|
else
|
|
BRANCH="sync/claude-plugin-${SHORT_SHA}"
|
|
git checkout -b "$BRANCH"
|
|
git commit -m "sync Claude plugin skills from firecrawl/cli (${SHORT_SHA})"
|
|
git push origin "$BRANCH"
|
|
PR_URL=$(gh pr create \
|
|
--repo firecrawl/firecrawl-claude-plugin \
|
|
--title "sync Claude plugin skills (${SHORT_SHA})" \
|
|
--body "Automated sync of \`skills/\` and \`.claude-plugin\` from [firecrawl/cli@${SHORT_SHA}](${COMMIT_URL})." \
|
|
--base main \
|
|
--head "$BRANCH")
|
|
echo "Created PR: $PR_URL"
|
|
# Merge immediately. --auto requires branch protection with
|
|
# required checks on the target repo, which firecrawl-claude-plugin
|
|
# doesn't have, and there's nothing to wait for on a sync PR anyway.
|
|
gh pr merge --repo firecrawl/firecrawl-claude-plugin --merge --delete-branch "$PR_URL"
|
|
fi
|