Skip to content

Commit e34ff64

Browse files
authored
Update monitor-prs.yml
Signed-off-by: Kay-Tian <[email protected]>
1 parent c11e8df commit e34ff64

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

.github/workflows/monitor-prs.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,23 @@ jobs:
1212
- name: Checkout code
1313
uses: actions/checkout@v4
1414

15+
- name: Validate watch-files.txt exists
16+
run: |
17+
# 检查配置文件是否存在,不存在则报错退出
18+
if [ ! -f "watch-files.txt" ]; then
19+
echo "❌ 未找到 watch-files.txt,请在仓库根目录创建该文件"
20+
exit 1
21+
fi
22+
echo "✅ 找到 watch-files.txt,准备读取监控列表"
23+
24+
- name: Read watch files from config
25+
id: read_watch_files
26+
run: |
27+
# 读取配置文件,过滤注释(# 开头)和空行,保存为环境变量
28+
# 使用 tr 替换换行符为空格,后续在循环中再拆分为行
29+
WATCH_FILES=$(grep -v '^#\|^$' watch-files.txt | tr '\n' ' ')
30+
echo "WATCH_FILES=$WATCH_FILES" >> $GITHUB_ENV # 写入环境变量
31+
1532
- name: Set up tools and authenticate gh CLI
1633
run: |
1734
# 安装依赖工具
@@ -71,12 +88,15 @@ jobs:
7188
- name: Fetch open PRs and check files
7289
env:
7390
TARGET_REPO: "vllm-project/vllm"
74-
WATCH_FILES: |
75-
vllm/attention/layer.py
7691
GITHUB_TOKEN: ${{ secrets.PAT }}
7792
run: |
7893
set -euo pipefail
7994
95+
# 从环境变量中读取监控列表,替换空格为换行符(恢复为行格式)
96+
WATCH_FILES=$(echo "$WATCH_FILES" | tr ' ' '\n')
97+
echo "从 watch-files.txt 读取的监控列表:"
98+
echo "$WATCH_FILES"
99+
80100
PROCESSED_PRS=$(cat .processed_prs.json)
81101
echo "当前已处理PR列表: $PROCESSED_PRS"
82102

0 commit comments

Comments
 (0)