From 386678fc9d8739c57168baed1ada13e70c6677f6 Mon Sep 17 00:00:00 2001 From: augushong Date: Sun, 3 May 2026 21:25:54 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E7=A7=BB=E9=99=A4=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=B5=81=E4=B8=AD=E8=B0=83=E8=AF=95=E5=8F=98=E9=87=8F=E7=9A=84?= =?UTF-8?q?=E7=A1=AC=E7=BC=96=E7=A0=81=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除环境变量 APP_DEBUG_VALUE 和 DB_DEBUG_VALUE 的定义及其在 awk 脚本中的处理逻辑。 这些调试设置不应在部署工作流中硬编码,而应由环境配置文件或更灵活的机制管理。 --- .gitea/workflows/build-and-deploy.yml | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/.gitea/workflows/build-and-deploy.yml b/.gitea/workflows/build-and-deploy.yml index 9c79c9e..bff4cbc 100644 --- a/.gitea/workflows/build-and-deploy.yml +++ b/.gitea/workflows/build-and-deploy.yml @@ -9,8 +9,6 @@ env: PACKAGE_NAME: ulthon_admin_release.tar.gz COMPOSE_PROJECT_NAME: ulthon_admin DB_HOSTNAME: host.docker.internal - APP_DEBUG_VALUE: "false" - DB_DEBUG_VALUE: "false" jobs: deploy_host15: @@ -29,14 +27,12 @@ jobs: env: MYSQL_PASSWORD: ${{ secrets.MYSQL_PASSWORD }} DB_HOSTNAME: ${{ env.DB_HOSTNAME }} - APP_DEBUG_VALUE: ${{ env.APP_DEBUG_VALUE }} - DB_DEBUG_VALUE: ${{ env.DB_DEBUG_VALUE }} run: | set -euo pipefail cp .example.env .env - awk -v host="$DB_HOSTNAME" -v newpwd="$MYSQL_PASSWORD" -v app_debug="$APP_DEBUG_VALUE" -v db_debug="$DB_DEBUG_VALUE" ' - BEGIN { has_host = 0; has_pwd = 0; has_app_debug = 0; has_db_debug = 0 } + awk -v host="$DB_HOSTNAME" -v newpwd="$MYSQL_PASSWORD" ' + BEGIN { has_host = 0; has_pwd = 0 } $0 ~ /^HOSTNAME=/ { print "HOSTNAME=" host has_host = 1 @@ -47,22 +43,10 @@ jobs: has_pwd = 1 next } - $0 ~ /^APP_DEBUG=/ { - print "APP_DEBUG=" app_debug - has_app_debug = 1 - next - } - $0 ~ /^DEBUG=/ { - print "DEBUG=" db_debug - has_db_debug = 1 - next - } { print } END { if (!has_host) print "HOSTNAME=" host if (!has_pwd) print "PASSWORD=" newpwd - if (!has_app_debug) print "APP_DEBUG=" app_debug - if (!has_db_debug) print "DEBUG=" db_debug }' .env > .env.tmp mv .env.tmp .env