This commit is contained in:
parent
6cfd715cb7
commit
9a2a6d9a04
@ -99,23 +99,10 @@ jobs:
|
||||
id: parse-release
|
||||
run: |
|
||||
commit_message="${{ github.event.head_commit.message }}"
|
||||
# 找到 Release=" 的起始位置
|
||||
start_index=$(expr index "$commit_message" 'Release="')
|
||||
if [ $start_index -eq 0 ]; then
|
||||
title=$(echo "$commit_message" | cut -d ' ' -f 3-)
|
||||
if [ -z "$title" ]; 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"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user