File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,8 +22,9 @@ cd /Volumes/KIOXIA/blog-project && bash news_pipeline/scripts/heartbeat-cycle.sh
22222 . ` news-pipeline process `
23233 . ` news-pipeline queue summary `
24244 . ` news-pipeline autopublish --limit 1 --min-score 0.68 `
25- 5 . ` news-pipeline queue review `
26- 6 . ` news-pipeline queue list --status new `
25+ 5 . autopublish varsa ilgili dosyayı git commit + push et
26+ 6 . ` news-pipeline queue review `
27+ 7 . ` news-pipeline queue list --status new `
2728
2829## Heartbeat karar kuralı
2930
@@ -72,5 +73,6 @@ Uzun rapor dökme.
7273
7374Bu runbook'ta publish kararı Nyx'in editoryal değerlendirmesinden sonra heartbeat içinde gelebilir.
7475Uygun aday bulunduğunda kayıt doğrudan canlı ` src/content/anlikHaber/ ` klasörüne yazılır.
76+ Heartbeat script'i bu canlı dosyayı ardından otomatik git commit + push ile repoya gönderir.
7577Ama ` manual-review ` veya kırmızı bayraklı kayıtlar otomatik publish edilmez.
7678İlk güvenli modda heartbeat başına en fazla 1 kayıt publish edilir.
Original file line number Diff line number Diff line change @@ -13,7 +13,14 @@ echo "--- HEARTBEAT SUMMARY ---"
1313news-pipeline queue summary || true
1414
1515echo " --- AUTOPUBLISH ---"
16- news-pipeline autopublish --limit 1 --min-score 0.68 || true
16+ autopublish_output=" $( news-pipeline autopublish --limit 1 --min-score 0.68 || true) "
17+ printf ' %s\n' " $autopublish_output "
18+
19+ mapfile -t autopublished_paths < <( printf ' %s\n' " $autopublish_output " | sed -n ' s/^autopublished: .* -> \(\/.*\.md\)$/\1/p' )
20+ if [ " ${# autopublished_paths[@]} " -gt 0 ]; then
21+ echo " --- GIT PUSH ---"
22+ bash news_pipeline/scripts/push-autopublished.sh " ${autopublished_paths[@]} "
23+ fi
1724
1825echo " --- MANUAL REVIEW ---"
1926news-pipeline queue review | sed -n ' 1,5p' || true
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -euo pipefail
3+
4+ ROOT=" /Volumes/KIOXIA/blog-project"
5+ cd " $ROOT "
6+
7+ if [ " $# " -eq 0 ]; then
8+ exit 0
9+ fi
10+
11+ paths=()
12+ for path in " $@ " ; do
13+ if [ -f " $path " ]; then
14+ paths+=(" $path " )
15+ fi
16+ done
17+
18+ if [ " ${# paths[@]} " -eq 0 ]; then
19+ exit 0
20+ fi
21+
22+ git add -- " ${paths[@]} "
23+
24+ if git diff --cached --quiet; then
25+ exit 0
26+ fi
27+
28+ first_slug=" $( basename " ${paths[0]} " .md) "
29+ commit_message=" news: autopublish ${first_slug} "
30+
31+ git commit -m " $commit_message "
32+ git push origin main
You can’t perform that action at this time.
0 commit comments