-
Notifications
You must be signed in to change notification settings - Fork 642
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Kay Yan <[email protected]>
- Loading branch information
Showing
1 changed file
with
6 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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:-}" == "" ] && { | ||
|
@@ -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:]])/}" | ||
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]}" | ||
|
@@ -73,6 +76,7 @@ jobs: | |
# Save it | ||
IFS= | ||
echo "GO_VERSION=${norm[*]}" >> $GITHUB_ENV | ||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 1 | ||
|