Files
inspiration-collector/scripts/run_weekly_work_report.sh

30 lines
924 B
Bash
Executable File

#!/bin/bash
# Weekly work report generator
# Reads 7 daily work logs → DeepSeek API → weekly work analysis
# Run: weekly, Sunday 17:00 Beijing time (09:00 UTC)
set -e
INSP_DIR="/home/ubuntu/inspiration-collector"
LOG_FILE="/tmp/weekly_work_report_$(date +%Y%m%d_%H%M).log"
echo "[$(date)] Starting weekly work report..." | tee "$LOG_FILE"
cd "$INSP_DIR"
git pull origin main 2>&1 | tee -a "$LOG_FILE"
echo "[$(date)] Running analyzer..." | tee -a "$LOG_FILE"
python3 analyzers/weekly_work_report.py 2>&1 | tee -a "$LOG_FILE"
echo "[$(date)] Committing and pushing..." | tee -a "$LOG_FILE"
git add ai-insights/weekly/ 2>/dev/null || true
if git diff --cached --quiet; then
echo "[$(date)] No changes" | tee -a "$LOG_FILE"
else
git commit -m "weekly: work report $(date +%Y-%m-%d)" 2>&1 | tee -a "$LOG_FILE"
git push origin main 2>&1 | tee -a "$LOG_FILE"
fi
echo "[$(date)] Done." | tee -a "$LOG_FILE"