Skip to content

Commit 266203b

Browse files
authored
Merge pull request #3314 from yankay/fix-set-go-env
Fix canary test fail in windows by trim the `line` string
2 parents 74f2755 + f23fcd7 commit 266203b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

.github/workflows/test-canary.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ jobs:
4848
steps:
4949
- name: Set GO env
5050
run: |
51+
# Enable extended globbing features to use advanced pattern matching
52+
shopt -s extglob
53+
5154
# Get latest containerd
5255
args=(curl --proto '=https' --tlsv1.2 -fsSL -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28")
5356
[ "${GITHUB_TOKEN:-}" == "" ] && {
@@ -59,7 +62,8 @@ jobs:
5962
# Get latest golang version and split it in components
6063
norm=()
6164
while read -r line; do
62-
norm+=("$line")
65+
line_trimmed="${line//+([[:space:]])/}"
66+
norm+=("$line_trimmed")
6367
done < \
6468
<(sed -E 's/^go([0-9]+)[.]([0-9]+)([.]([0-9]+))?(([a-z]+)([0-9]+))?/\1.\2\n\4\n\6\n\7/i' \
6569
<(curl -fsSL "https://go.dev/dl/?mode=json&include=all" | jq -rc .[0].version) \

0 commit comments

Comments
 (0)