Skip to content

Commit 20a3c10

Browse files
committed
```
fix(.github/workflows/release.yml): 移除extglob依赖并优化字符串修剪逻辑 移除了对extglob特性的依赖,改用sed命令进行字符串首尾空白去除, 以提高脚本在不同环境下的兼容性 ```
1 parent d2397d8 commit 20a3c10

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ jobs:
117117
shell: bash
118118
run: |
119119
set -euo pipefail
120-
shopt -s extglob
121120
CURRENT_TAG="${{ needs.build.outputs.release_tag }}"
122121
123122
# 获取上一个 tag(排除当前 tag)
@@ -134,8 +133,8 @@ jobs:
134133
trim() {
135134
local s="$1"
136135
s="${s//$'\r'/}"
137-
s="${s##+([[:space:]])}"
138-
s="${s%%+([[:space:]])}"
136+
# 使用 sed 去除首尾空白(更兼容,避免 extglob 解析问题)
137+
s="$(printf '%s' "$s" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')"
139138
printf '%s' "$s"
140139
}
141140

0 commit comments

Comments
 (0)