mirror of
https://github.com/SECTL/SecScore.git
synced 2026-07-19 19:04:23 +08:00
ci: 移除 push 触发并简化 workflow 逻辑
简化 build.yml 工作流配置,移除 push 触发事件,仅保留 workflow_dispatch 触发方式
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
name: build
|
name: build
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
version:
|
version:
|
||||||
@@ -34,30 +33,11 @@ jobs:
|
|||||||
id: msg
|
id: msg
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
{
|
||||||
{
|
echo "message<<__EOF__"
|
||||||
echo "message<<__EOF__"
|
echo "${{ github.event.inputs.version }} ${{ github.event.inputs.build }}"
|
||||||
echo "${{ github.event.inputs.version }} ${{ github.event.inputs.build }}"
|
echo "__EOF__"
|
||||||
echo "__EOF__"
|
} >> "$GITHUB_OUTPUT"
|
||||||
} >> "$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__"
|
|
||||||
echo "${{ github.event.head_commit.message }}"
|
|
||||||
echo "__EOF__"
|
|
||||||
} >> "$GITHUB_OUTPUT"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- uses: actions/setup-node@v4
|
- uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
|
|||||||
Reference in New Issue
Block a user