File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed
Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -81,15 +81,16 @@ runs:
8181 run : |
8282 set -e
8383
84- # Resolve empty / 'null' / 'latest' to a concrete version number
85- lower_req="$(printf '%s' "$REQUESTED_VERSION" | tr '[:upper:]' '[:lower:]')"
86- if [[ -z "$REQUESTED_VERSION" || "$lower_req" == "latest" || "$lower_req" == "null" ]]; then
87- REQUESTED_VERSION=$(
88- curl -s https://api.github.com/repos/PowerShell/PowerShell/releases/latest |
89- grep '"tag_name"' | head -n1 | sed -E 's/.*"v?([^"]+)".*/\1/'
90- )
91- echo "Latest stable PowerShell release detected: $REQUESTED_VERSION"
92- fi
84+ case "${REQUESTED_VERSION:-}" in
85+ "" | [Ll][Aa][Tt][Ee][Ss][Tt] | [Nn][Uu][Ll][Ll])
86+ REQUESTED_VERSION=$(
87+ curl -s https://api.github.com/repos/PowerShell/PowerShell/releases/latest |
88+ grep '"tag_name"' | head -n1 |
89+ sed -E 's/.*"v?([^"]+)".*/\1/'
90+ )
91+ echo "Latest stable PowerShell release detected: $REQUESTED_VERSION"
92+ ;;
93+ esac
9394
9495 DETECTED_VERSION=$(pwsh -NoLogo -NoProfile -Command '$PSVersionTable.PSVersion.ToString()' 2>/dev/null || true)
9596 if [[ "$DETECTED_VERSION" == "$REQUESTED_VERSION" ]]; then
You can’t perform that action at this time.
0 commit comments