🔧 门禁代码审查修复: 增强空行过滤、revert错误处理、grep兼容性
Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com>
This commit is contained in:
parent
203d5c5633
commit
fe81282bab
|
|
@ -2,6 +2,7 @@
|
|||
"version": "1.0.0",
|
||||
"updated_at": "2026-03-16",
|
||||
"description": "铸渊·智能门禁 · 开发者权限矩阵配置",
|
||||
"note": "developer_permissions 中的 github_usernames 需要由管理员填入实际的 GitHub 用户名,未填入的开发者将被视为未注册开发者",
|
||||
"whitelist_actors": [
|
||||
"github-actions[bot]",
|
||||
"qinfendebingshuo"
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ jobs:
|
|||
|
||||
# 系统前缀 commit → 直接放行
|
||||
SYSTEM_PREFIXES="🔍|📊|📡|🧠|📢|🚨|📰|🔧"
|
||||
if echo "$COMMIT_MSG" | head -1 | grep -qP "^($SYSTEM_PREFIXES)"; then
|
||||
if echo "$COMMIT_MSG" | head -1 | grep -qE "^($SYSTEM_PREFIXES)"; then
|
||||
echo "ℹ️ 系统前缀 commit,直接放行"
|
||||
echo "is_system=true" >> $GITHUB_OUTPUT
|
||||
else
|
||||
|
|
@ -85,6 +85,7 @@ jobs:
|
|||
- name: "❌ 违规·回退 commit"
|
||||
if: steps.verdict.outputs.action == 'revert'
|
||||
run: |
|
||||
set -e
|
||||
git config user.name "zhuyuan-bot"
|
||||
git config user.email "zhuyuan@guanghulab.com"
|
||||
git revert HEAD --no-edit
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ function loadChangedFiles() {
|
|||
try {
|
||||
const content = fs.readFileSync(CHANGED_FILES_PATH, 'utf8').trim();
|
||||
if (!content) return [];
|
||||
return content.split('\n').filter(f => f.trim());
|
||||
return content.split('\n').map(f => f.trim()).filter(f => f !== '');
|
||||
} catch (e) {
|
||||
console.error('⚠️ 无法读取变更文件列表:', e.message);
|
||||
return [];
|
||||
|
|
|
|||
Loading…
Reference in New Issue