-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (85 loc) · 4.08 KB
/
Copy pathmonthly-digest.yml
File metadata and controls
112 lines (85 loc) · 4.08 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
110
111
112
name: Monthly digest
on:
# Schedule DISABLED 2026-04-25: large-input LLM task (read all month articles ~30KB)
# high risk of CF 524 timeout (same root cause as awesome + intel cron).
# Switching to manual mode — let Claude Code generate digest on user request.
# schedule:
# - cron: '0 3 1 * *'
workflow_dispatch:
permissions:
contents: write
concurrency:
group: monthly-digest
cancel-in-progress: false
jobs:
digest:
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Claude Code CLI
run: npm install -g @anthropic-ai/claude-code
- name: Configure git identity
run: |
git config user.email "noreply@llmapi.pro"
git config user.name "llmapi-pro automation"
- name: Compile previous-month digest
env:
ANTHROPIC_BASE_URL: ${{ secrets.ANTHROPIC_BASE_URL }}
ANTHROPIC_AUTH_TOKEN: ${{ secrets.ANTHROPIC_AUTH_TOKEN }}
run: |
# Compute previous month (e.g., if today is 2026-05-01, target is 2026-04)
TARGET_MONTH=$(date -u -d "yesterday" +%Y-%m)
MONTH_NAME=$(date -u -d "yesterday" +"%B %Y")
DIGEST_PATH="articles/${TARGET_MONTH}-monthly-digest.md"
echo "Target month: $TARGET_MONTH ($MONTH_NAME)"
echo "Digest path: $DIGEST_PATH"
# Skip if already exists (prevent duplicate runs)
if [ -f "$DIGEST_PATH" ]; then
echo "Digest already exists, skipping."
exit 0
fi
# List articles from target month
ls articles/${TARGET_MONTH}-*.md 2>/dev/null > /tmp/month-articles.txt || true
ARTICLE_COUNT=$(wc -l < /tmp/month-articles.txt)
if [ "$ARTICLE_COUNT" -lt 1 ]; then
echo "No articles from $TARGET_MONTH found; skipping digest."
exit 0
fi
cat > /tmp/prompt.txt <<PROMPT_EOF
You are compiling a monthly digest for the llmapi-pro/journal blog. The blog covers engineering work on an Anthropic-protocol-compatible API relay.
Target month: ${MONTH_NAME} (${TARGET_MONTH})
Output file: ${DIGEST_PATH}
=== HARD RULES — PRIVACY & TRUST ===
The digest is PUBLIC. Do NOT mention or imply: capturing user data, injecting/modifying user prompts, cross-session memory, behavioral metrics, or A/B testing on real users. If a referenced article touched these themes (it should not, but verify), summarize only the safe portions.
TASK
1. Read all articles in articles/${TARGET_MONTH}-*.md (excluding any existing digest file).
2. Write articles/${TARGET_MONTH}-monthly-digest.md with structure:
# Monthly digest: ${MONTH_NAME}
*Posted YYYY-MM-DD · ~3 min read*
> One-paragraph framing: what was the dominant theme this month?
## Articles
For each article, write:
- **[Article Title](./YYYY-MM-DD-slug.md)** — 2-3 sentence factual summary. No marketing language.
## Themes & throughlines
(1-2 short paragraphs identifying patterns across the articles)
## What's planned next
(1 short paragraph; speculate carefully, don't promise)
---
*[← Back to journal index](../README.md)*
3. Update README.md to add a link to the digest under a new \`### Monthly digests\` section (create if missing) at top of Contents.
4. Word count: 500-1200 words for digest body.
5. Commit and push:
git add articles/${TARGET_MONTH}-monthly-digest.md README.md
git commit -m "Add ${MONTH_NAME} monthly digest"
git push origin main
Final message: digest URL, article count summarized, wordcount.
PROMPT_EOF
claude --print --dangerously-skip-permissions --allowedTools "Bash,Read,Write,Edit,Glob,Grep" < /tmp/prompt.txt