Skip to content

Commit da17262

Browse files
BinHPdevclaude
andcommitted
Fix review issues in weekly-update workflow
- setup_runner.sh: accept token as arg/env, reject placeholder - workflow: add git pull --rebase to prevent push conflicts - workflow: inject current date into prompt for accurate search - workflow: add Bash(date*) to allowedTools - gitignore: add last-update-log.md Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 7c85ad3 commit da17262

3 files changed

Lines changed: 14 additions & 3 deletions

File tree

.github/workflows/weekly-update.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ jobs:
2121
with:
2222
token: ${{ secrets.GITHUB_TOKEN }}
2323

24+
- name: 拉取最新代码
25+
run: git pull origin main --rebase
26+
2427
- name: 检查 Claude CLI
2528
run: |
2629
command -v claude || { echo "❌ claude CLI not found"; exit 1; }
@@ -32,12 +35,12 @@ jobs:
3235
# 防止 Mac 休眠
3336
caffeinate -s -w $$ &
3437
35-
PROMPT=$(cat .github/prompts/weekly-update.md)
38+
PROMPT="Today is $(date +%Y-%m-%d). $(cat .github/prompts/weekly-update.md)"
3639
echo "🔍 开始搜索最新算法自动化工具..."
3740
3841
claude -p "$PROMPT" \
3942
--max-turns 30 \
40-
--allowedTools "WebSearch,Read,Edit,Write,Glob,Grep,Bash(git diff*),Bash(git status*),Bash(wc *)" \
43+
--allowedTools "WebSearch,Read,Edit,Write,Glob,Grep,Bash(git diff*),Bash(git status*),Bash(wc *),Bash(date*)" \
4144
2>&1 | tee /tmp/awesome-algo-update.log
4245
4346
echo "✅ Claude 搜索完成"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# Update script logs
22
scripts/*.log
33
scripts/last-run-*.log
4+
.github/last-update-log.md

scripts/setup_runner.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,15 @@
2121
set -e
2222

2323
GITHUB_REPO="https://github.com/BinHPdev/awesome-algorithm-auto-tools"
24-
RUNNER_TOKEN="YOUR_RUNNER_TOKEN_FROM_GITHUB"
24+
RUNNER_TOKEN="${1:-$RUNNER_TOKEN}"
2525
RUNNER_NAME="algo-tools-runner"
26+
27+
if [ -z "$RUNNER_TOKEN" ] || [ "$RUNNER_TOKEN" = "YOUR_RUNNER_TOKEN_FROM_GITHUB" ]; then
28+
echo "❌ 请提供 Runner Token:"
29+
echo " 用法: ./scripts/setup_runner.sh <YOUR_TOKEN>"
30+
echo " 或: RUNNER_TOKEN=xxx ./scripts/setup_runner.sh"
31+
exit 1
32+
fi
2633
RUNNER_DIR="$HOME/actions-runner-algo"
2734

2835
echo "======================================"

0 commit comments

Comments
 (0)