-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (72 loc) · 3.24 KB
/
Copy pathllm-exports-full-sync.yml
File metadata and controls
82 lines (72 loc) · 3.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Full regen: wipe per-target generated subtrees, then re-export (removes orphans from renames/deletes in .cursor).
# Rolling incremental updates use "LLM exports sync" and branch `llm`. This workflow is on-demand; branch `llm-full`.
# Plain Node (no root npm install); see package.json llm:exports:sync:full.
#
# Do not add push, pull_request, schedule, workflow_run, or other automatic triggers. Manual run only
# (Actions → LLM exports full → Run workflow).
name: LLM exports full
on:
workflow_dispatch: {}
concurrency:
group: llm-exports-full-${{ github.ref }}
cancel-in-progress: true
jobs:
publish_llm_full_pr:
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 10
permissions:
contents: write
pull-requests: write
steps:
- name: Checkout develop
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: develop
fetch-depth: 0
- name: Use Node
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Generate exports (full)
run: node scripts/llm/export-from-cursor.mjs sync --full
- name: Stage export tree
# peter-evans/create-pull-request respects .gitignore; machine output is ignored locally
# — force-add gitignored export paths
run: |
set -e
git add -A -f -- .llm/exports
- name: Create or update llm-full PR
id: cpr
uses: peter-evans/create-pull-request@v8
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: llm-full
base: develop
add-paths: .llm/exports
commit-message: "chore(llm): full regen .llm/exports from .cursor"
title: "chore(llm): full regen .llm/exports from .cursor"
body: |
On-demand full LLM export regen from `.cursor` + `.cursorrules`.
- Source of truth remains `.cursor/**` and `.cursorrules`
- Orphans under per-target `skills/`, `instructions/`, and root `*-instructions.md` are removed for full regen, then the export is regenerated
- For day-to-day updates use workflow **LLM exports sync** (branch `llm`); use **LLM exports full** for catch-up / after large renames
labels: |
llm
delete-branch: false
- name: Keep only the latest open llm-full PR
if: always()
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
prs_json=$(gh api "repos/${{ github.repository }}/pulls?state=open&head=${{ github.repository_owner }}:llm-full&base=develop&per_page=100")
mapfile -t prs < <(node -e "const prs=JSON.parse(process.argv[1]||'[]'); prs.sort((a,b)=>new Date(b.updated_at)-new Date(a.updated_at)); for (const pr of prs) console.log(pr.number);" "$prs_json")
if [ "${#prs[@]}" -le 1 ]; then
echo "No duplicate llm-full PRs to close."
exit 0
fi
echo "Keeping PR #${prs[0]} and closing ${#prs[@]}-1 duplicate(s)."
for n in "${prs[@]:1}"; do
gh pr close "$n" --repo "${{ github.repository }}" --comment "Closing duplicate llm-full automation PR; branch llm-full reuses a single rolling PR into develop."
done