From fe81282babd37adac888d582846aeb7a3d0ae85d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Mar 2026 05:02:54 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20=E9=97=A8=E7=A6=81=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E5=AE=A1=E6=9F=A5=E4=BF=AE=E5=A4=8D:=20=E5=A2=9E?= =?UTF-8?q?=E5=BC=BA=E7=A9=BA=E8=A1=8C=E8=BF=87=E6=BB=A4=E3=80=81revert?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E5=A4=84=E7=90=86=E3=80=81grep=E5=85=BC?= =?UTF-8?q?=E5=AE=B9=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: qinfendebingshuo <207279273+qinfendebingshuo@users.noreply.github.com> --- .github/persona-brain/gate-guard-config.json | 1 + .github/workflows/zhuyuan-gate-guard.yml | 3 ++- scripts/gate-guard.js | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) 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 [];