diff --git a/.github/persona-brain/gate-guard-config.json b/.github/persona-brain/gate-guard-config.json index 4bb59b01..582e8826 100644 --- a/.github/persona-brain/gate-guard-config.json +++ b/.github/persona-brain/gate-guard-config.json @@ -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" diff --git a/.github/workflows/zhuyuan-gate-guard.yml b/.github/workflows/zhuyuan-gate-guard.yml index 218a254f..ec6d983b 100644 --- a/.github/workflows/zhuyuan-gate-guard.yml +++ b/.github/workflows/zhuyuan-gate-guard.yml @@ -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 diff --git a/scripts/gate-guard.js b/scripts/gate-guard.js index 9dab8959..8891aa7a 100644 --- a/scripts/gate-guard.js +++ b/scripts/gate-guard.js @@ -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 [];