From ecb32daba9231be38f9cfa69d2cbad2014c8c769 Mon Sep 17 00:00:00 2001 From: JSR Date: Sat, 28 Mar 2026 08:32:01 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20push=20=E6=97=B6=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=85=A8=E5=B9=B3=E5=8F=B0=E6=9E=84=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7901063..57191db 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,6 +40,17 @@ jobs: echo "${{ github.event.inputs.version }} ${{ github.event.inputs.build }}" echo "__EOF__" } >> "$GITHUB_OUTPUT" + elif [ "${{ github.event_name }}" = "push" ]; then + VERSION="$(sed -n 's/.*"version":[[:space:]]*"\([^"]*\)".*/\1/p' package.json | head -n 1)" + if [ -z "$VERSION" ]; then + echo "无法从 package.json 读取 version 字段" >&2 + exit 1 + fi + { + echo "message<<__EOF__" + echo "$VERSION build:all" + echo "__EOF__" + } >> "$GITHUB_OUTPUT" else { echo "message<<__EOF__"