Skip to content

Commit

Permalink
fix set go env in windows
Browse files Browse the repository at this point in the history
Signed-off-by: Kay Yan <[email protected]>
  • Loading branch information
yankay committed Aug 15, 2024
1 parent 74f2755 commit 571846b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/test-canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ jobs:
steps:
- name: Set GO env
run: |
# Enable extended globbing features to use advanced pattern matching
shopt -s extglob
# Get latest containerd
args=(curl --proto '=https' --tlsv1.2 -fsSL -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28")
[ "${GITHUB_TOKEN:-}" == "" ] && {
Expand All @@ -59,12 +62,12 @@ jobs:
# Get latest golang version and split it in components
norm=()
while read -r line; do
norm+=("$line")
line_trimmed = "${line//+([[:space:]])/}"

Check failure on line 65 in .github/workflows/test-canary.yml

View workflow job for this annotation

GitHub Actions / lint

65:54 [trailing-spaces] trailing spaces
norm+=("$line_trimmed")
done < \
<(sed -E 's/^go([0-9]+)[.]([0-9]+)([.]([0-9]+))?(([a-z]+)([0-9]+))?/\1.\2\n\4\n\6\n\7/i' \
<(curl -fsSL "https://go.dev/dl/?mode=json&include=all" | jq -rc .[0].version) \
)
# Serialize version, making sure we have a patch version, and separate possible rcX into .rc-X
[ "${norm[1]}" != "" ] || norm[1]="0"
norm[1]=".${norm[1]}"
Expand All @@ -73,6 +76,7 @@ jobs:
# Save it
IFS=
echo "GO_VERSION=${norm[*]}" >> $GITHUB_ENV
- uses: actions/[email protected]
with:
fetch-depth: 1
Expand Down

0 comments on commit 571846b

Please sign in to comment.