This commit is contained in:
parent
ddd10379d1
commit
6cfd715cb7
@ -98,9 +98,26 @@ jobs:
|
||||
- name: 解析Release标题
|
||||
id: parse-release
|
||||
run: |
|
||||
RELEASE_NAME=$(echo "${{ github.event.head_commit.message }}" | sed 's/.*"\([^"]*\)".*/\1/')
|
||||
echo "ReleaseName=$RELEASE_NAME" >> $GITHUB_OUTPUT
|
||||
echo "ReleaseName = $RELEASE_NAME"
|
||||
commit_message="${{ github.event.head_commit.message }}"
|
||||
# 找到 Release=" 的起始位置
|
||||
start_index=$(expr index "$commit_message" 'Release="')
|
||||
if [ $start_index -eq 0 ]; then
|
||||
echo "未在提交信息中找到 Release 标题。"
|
||||
title="default_title"
|
||||
else
|
||||
# 截取从 Release=" 之后的字符串
|
||||
substring=${commit_message:$((start_index + 9))}
|
||||
# 找到下一个 " 的位置
|
||||
end_index=$(expr index "$substring" '"')
|
||||
if [ $end_index -eq 0 ]; then
|
||||
echo "未在提交信息中找到 Release 标题的结束引号。"
|
||||
title="default_title"
|
||||
else
|
||||
# 提取标题
|
||||
title=${substring:0:$((end_index - 1))}
|
||||
fi
|
||||
fi
|
||||
echo "::set-output name=title::$title"
|
||||
|
||||
- name: 获取最终Release信息
|
||||
run: |
|
||||
|
Loading…
Reference in New Issue
Block a user