From b6fffab8855a2623d79fef4e4b1bd4714067b100 Mon Sep 17 00:00:00 2001 From: starmen1265 Date: Sun, 1 Mar 2026 23:51:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BD=BF=E7=94=A8=20set=20-e=20?= =?UTF-8?q?=E8=AE=A9=E8=AF=AD=E6=B3=95=E9=94=99=E8=AF=AF=E7=9B=B4=E6=8E=A5?= =?UTF-8?q?=E9=80=80=E5=87=BA=E5=B9=B6=E6=98=BE=E7=A4=BA=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/ci.yml | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 83c24b6..1f4af28 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -22,21 +22,10 @@ jobs: - name: PHP 语法检查 run: | + set -e echo "📝 PHP 语法检查..." - - # 检查所有 PHP 文件(排除 vendor),保存完整输出 - { - find . -name "*.php" -not -path "./vendor/*" -exec sh -c 'php -l "$1" 2>&1 || true' _ {} \; - } > /tmp/lint_output.txt - - # 检查是否有错误 - if grep -q "^Parse error\|^Fatal error\|^Syntax error" /tmp/lint_output.txt; then - echo "❌ PHP 语法错误:" - cat /tmp/lint_output.txt - exit 1 - else - echo "✅ 所有 PHP 文件语法正确" - fi + find . -name "*.php" -not -path "./vendor/*" -print0 | xargs -0 -n1 php -l + echo "✅ 所有 PHP 文件语法正确" # 单元测试 test: