Repository navigation
109 lines (95 loc) · 3.72 KB
/
Copy pathsync.yml
File metadata and controls
109 lines (95 loc) · 3.72 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Sync backnotprop/pstack
on:
schedule:
- cron: "17 3 * * *"
workflow_dispatch:
inputs:
from:
description: Cursor commit to summarise from (skips the sync)
required: false
to:
description: Cursor commit to summarise to
required: false
permissions:
contents: write
issues: write
concurrency:
group: sync
cancel-in-progress: false
jobs:
sync:
if: ${{ !inputs.from }}
runs-on: ubuntu-latest
outputs:
from: ${{ steps.range.outputs.from }}
to: ${{ steps.range.outputs.to }}
moved: ${{ steps.upstream.outputs.moved }}
steps:
- uses: actions/checkout@v7
with:
ref: main
fetch-depth: 0
- name: Fetch backnotprop/pstack
run: |
git remote add michael https://github.com/backnotprop/pstack.git
git fetch michael main upstream
- name: Record the Cursor commits this sync spans
id: range
run: |
cursor_sha() { git log -1 --format=%s "$1" | sed -n 's|^upstream: cursor/plugins/pstack @ ||p'; }
echo "from=$(cursor_sha origin/upstream)" >> "$GITHUB_OUTPUT"
echo "to=$(cursor_sha michael/upstream)" >> "$GITHUB_OUTPUT"
- name: Merge michael/main
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git merge --no-ff --no-commit michael/main
if ! git rev-parse -q --verify MERGE_HEAD >/dev/null; then
echo "main already contains michael/main"
exit 0
fi
version=$(jq -r .version plugin.json)
sed -i "s/^version: .*/version: ${version}/" apm.yml
rm -rf .apm/agents
cp -r agents .apm/agents
git add apm.yml .apm/agents
git commit -m "Sync backnotprop/pstack @ $(git rev-parse --short michael/main) (${version})"
- name: Push
run: git push origin HEAD:main
- name: Set upstream to michael/upstream
id: upstream
run: |
git push --force origin refs/remotes/michael/upstream:refs/heads/upstream
echo "moved=true" >> "$GITHUB_OUTPUT"
- name: Check .apm/ covers everything pstack ships
run: |
diff -r agents .apm/agents
for manifest in plugin.json .cursor-plugin/plugin.json; do
jq -e 'keys - ["$schema", "name", "displayName", "version", "description", "author", "homepage", "repository", "license", "logo", "keywords", "category", "tags", "skills", "agents"] == []' "$manifest"
done
jq -e '.skills == "./skills/" and .agents == "./agents/"' .cursor-plugin/plugin.json
for component in rules commands hooks mcp.json .mcp.json; do
if [ -e "$component" ]; then
echo "::error::pstack now ships $component, which .apm/ does not cover"
exit 1
fi
done
digest:
needs: sync
if: ${{ always() && (inputs.from || (needs.sync.outputs.moved == 'true' && needs.sync.outputs.from != needs.sync.outputs.to)) }}
runs-on: ubuntu-latest
env:
FROM: ${{ inputs.from || needs.sync.outputs.from }}
TO: ${{ inputs.to || needs.sync.outputs.to }}
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v7
- uses: astral-sh/[email protected]
with:
enable-cache: false
- name: Summarise Lauren's changes
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
run: uv run .github/scripts/digest.py "$FROM" "$TO" "$RUNNER_TEMP"
- name: Open the digest issue
run: gh issue create -R "$GITHUB_REPOSITORY" --title "$(cat "$RUNNER_TEMP/title.txt")" --body-file "$RUNNER_TEMP/body.md"