Skip to content

Commit 948a179

Browse files
Refactor PowerShell installation: improve logic for fetching the latest stable release version; enhance command for better reliability and clarity.
1 parent 985f7da commit 948a179

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ runs:
8585
lower_req="$(printf '%s' "$REQUESTED_VERSION" | tr '[:upper:]' '[:lower:]')"
8686
if [[ -z "$REQUESTED_VERSION" || "$lower_req" == "latest" || "$lower_req" == "null" ]]; then
8787
REQUESTED_VERSION=$(
88-
curl -s https://api.github.com/repos/PowerShell/PowerShell/releases/latest \
89-
| grep -oP '"tag_name":\s*"\K([^"]+)' | sed 's/^v//'
88+
curl -s https://api.github.com/repos/PowerShell/PowerShell/releases/latest |
89+
grep '"tag_name"' | head -n1 | sed -E 's/.*"v?([^"]+)".*/\1/'
9090
)
9191
echo "Latest stable PowerShell release detected: $REQUESTED_VERSION"
9292
fi

0 commit comments

Comments
 (0)