mirror of
https://github.com/firecrawl/cli.git
synced 2026-09-14 17:30:55 +08:00
df6a4712a1
gh pr merge --auto requires branch protection with required status checks on the target branch. firecrawl-claude-plugin and firecrawl-cursor-plugin don't have that configured, so the workflows fail with "Protected branch rules not configured for this branch (enablePullRequestAutoMerge)" after successfully creating the PR. There's nothing to wait for on a sync PR anyway, so drop --auto and merge immediately.
70 lines
2.5 KiB
YAML
70 lines
2.5 KiB
YAML
name: Sync Firecrawl Skill to Cursor Plugin
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- 'skills/firecrawl-cli/**'
|
|
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-cursor-plugin.git target 2>/dev/null || {
|
|
mkdir target && cd target && git init
|
|
git remote add origin https://x-access-token:${TOKEN}@github.com/firecrawl/firecrawl-cursor-plugin.git
|
|
}
|
|
|
|
- name: Sync firecrawl skill
|
|
env:
|
|
GH_TOKEN: ${{ secrets.FIRECRAWL_SKILLS_SYNC }}
|
|
run: |
|
|
cd target
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
|
|
rm -rf skills/firecrawl
|
|
mkdir -p skills/firecrawl
|
|
cp -R ../cli/skills/firecrawl-cli/. skills/firecrawl/
|
|
|
|
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 firecrawl skill from firecrawl/cli (${SHORT_SHA})"
|
|
git push origin main
|
|
else
|
|
BRANCH="sync/cursor-skill-${SHORT_SHA}"
|
|
git checkout -b "$BRANCH"
|
|
git commit -m "sync firecrawl skill from firecrawl/cli (${SHORT_SHA})"
|
|
git push origin "$BRANCH"
|
|
PR_URL=$(gh pr create \
|
|
--repo firecrawl/firecrawl-cursor-plugin \
|
|
--title "sync firecrawl skill (${SHORT_SHA})" \
|
|
--body "Automated sync of \`skills/firecrawl-cli\` from [firecrawl/cli@${SHORT_SHA}](${COMMIT_URL}) into \`skills/firecrawl\`." \
|
|
--base main \
|
|
--head "$BRANCH")
|
|
echo "Created PR: $PR_URL"
|
|
# Merge immediately. --auto requires branch protection with
|
|
# required checks on the target repo, which firecrawl-cursor-plugin
|
|
# doesn't have, and there's nothing to wait for on a sync PR anyway.
|
|
gh pr merge --repo firecrawl/firecrawl-cursor-plugin --merge --delete-branch "$PR_URL"
|
|
fi
|