From cf468f51cf2c88cee93c43b8fa24ca8beda375a0 Mon Sep 17 00:00:00 2001 From: wangjia <809946525@qq.com> Date: Wed, 17 Jun 2026 23:42:06 +0800 Subject: [PATCH] =?UTF-8?q?ci(devops):=20Windows=20runner=20=E5=B0=86=20sh?= =?UTF-8?q?ell=20=E9=92=89=E5=88=B0=20Git=20for=20Windows=20=E8=87=AA?= =?UTF-8?q?=E5=B8=A6=20bash=20=E7=BB=9D=E5=AF=B9=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Git 安装包默认只把 git.exe 加入 PATH(Git\cmd),不含 bash.exe(Git\bin), 导致 act_runner 解析 `shell: bash` 时报「Cannot find: bash in PATH」。 改用 GitHub Actions 官方等价写法,绕过 PATH 查找: C:\Program Files\Git\bin\bash.exe --noprofile --norc -eo pipefail {0} (bin\bash.exe 包装器会注入 /usr/bin,使脚本内 sh/powershell 可解析) Co-Authored-By: Claude Opus 4.8 --- .gitea/workflows/build-windows.yml | 4 ++-- .gitea/workflows/deploy-client.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/build-windows.yml b/.gitea/workflows/build-windows.yml index 0f0d39f..0850551 100644 --- a/.gitea/workflows/build-windows.yml +++ b/.gitea/workflows/build-windows.yml @@ -28,11 +28,11 @@ jobs: - uses: actions/checkout@v4 - name: Provision (idempotent — auto-runs if host not initialized) - shell: bash + shell: 'C:\Program Files\Git\bin\bash.exe --noprofile --norc -eo pipefail {0}' run: sh scripts/ci/provision-windows.sh - name: Compile (Flutter Windows) - shell: bash + shell: 'C:\Program Files\Git\bin\bash.exe --noprofile --norc -eo pipefail {0}' run: sh scripts/ci/compile-windows.sh "${{ inputs.ver || 'v1.0.4' }}" - name: Upload windows artifact diff --git a/.gitea/workflows/deploy-client.yml b/.gitea/workflows/deploy-client.yml index 41d467d..d796c2a 100644 --- a/.gitea/workflows/deploy-client.yml +++ b/.gitea/workflows/deploy-client.yml @@ -122,11 +122,11 @@ jobs: - uses: actions/checkout@v4 - name: Provision (idempotent — auto-runs if host not initialized) - shell: bash + shell: 'C:\Program Files\Git\bin\bash.exe --noprofile --norc -eo pipefail {0}' run: sh scripts/ci/provision-windows.sh - name: Compile (Flutter Windows) - shell: bash + shell: 'C:\Program Files\Git\bin\bash.exe --noprofile --norc -eo pipefail {0}' run: sh scripts/ci/compile-windows.sh "${{ gitea.ref_name }}" - name: Upload windows artifacts