Skip to content

Commit c9a393b

Browse files
Add WakaTime configuration to workflow
Added a new "Configure WakaTime" step that: 1. Checks for WAKE_TIME_API_KEY environment variable (optional) 2. Installs WakaTime CLI (pip install wakatime) 3. Creates ~/.wakatime.cfg with the API key 4. Installs claude-code-wakatime plugin via marketplace Configuration: Add WAKE_TIME_API_KEY to repository secrets to enable WakaTime tracking. Co-Authored-By: Claude (mimo-v2-flash) <noreply@anthropic.com>
1 parent cb16497 commit c9a393b

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.github/workflows/llm-bot-runner.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,42 @@ jobs:
163163
env:
164164
CONTEXT7_API_KEY: ${{ secrets.CONTEXT7_API_KEY }}
165165

166+
- name: Configure WakaTime
167+
run: |
168+
echo "检查 WakaTime 配置..."
169+
170+
# 检查 WAKE_TIME_API_KEY 环境变量
171+
if [ -z "$WAKE_TIME_API_KEY" ]; then
172+
echo "警告: WAKE_TIME_API_KEY 未设置,跳过 WakaTime 配置"
173+
exit 0
174+
fi
175+
176+
echo "WAKE_TIME_API_KEY 已设置,开始配置 WakaTime..."
177+
178+
# 安装 WakaTime CLI
179+
echo "安装 WakaTime CLI..."
180+
pip install wakatime
181+
182+
# 创建 ~/.wakatime.cfg 配置文件
183+
echo "创建 ~/.wakatime.cfg 配置文件..."
184+
mkdir -p ~
185+
cat > ~/.wakatime.cfg << CFGEOF
186+
[settings]
187+
api_key = $WAKE_TIME_API_KEY
188+
CFGEOF
189+
190+
echo "WakaTime 配置文件已创建:"
191+
cat ~/.wakatime.cfg
192+
193+
# 安装 claude-code-wakatime 插件
194+
echo "安装 claude-code-wakatime 插件..."
195+
claude plugin marketplace add https://github.com/wakatime/claude-code-wakatime.git
196+
claude plugin i claude-code-wakatime@wakatime
197+
198+
echo "WakaTime 配置完成"
199+
env:
200+
WAKE_TIME_API_KEY: ${{ secrets.WAKE_TIME_API_KEY }}
201+
166202
- name: Pre-configure Git
167203
run: |
168204
echo "配置Git用户信息..."

0 commit comments

Comments
 (0)