Skip to content

Commit 639da02

Browse files
committed
fix: add debug info
Signed-off-by: zongz <zongzhe1024@163.com>
1 parent aabc174 commit 639da02

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

.github/workflows/install-kcl-lsp.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,27 @@ jobs:
99
runs-on: ${{ matrix.os }}
1010
steps:
1111
- uses: actions/checkout@v3
12+
- name: Debug getLatestRelease function
13+
run: |
14+
getLatestRelease() {
15+
local KCLReleaseUrl="https://api.github.com/repos/${GITHUB_ORG}/${GITHUB_REPO}/releases"
16+
local latest_release=""
17+
18+
if [ "$KCL_HTTP_REQUEST_CLI" == "curl" ]; then
19+
response=$(curl -s $KCLReleaseUrl)
20+
echo "API Response: $response" # 打印 API 返回的数据
21+
latest_release=$(echo "$response" | grep \"tag_name\" | grep -v rc | awk 'NR==1{print $2}' | sed -n 's/\"\(.*\)\",/\1/p')
22+
else
23+
response=$(wget -q --header="Accept: application/json" -O - $KCLReleaseUrl)
24+
echo "API Response: $response" # 打印 API 返回的数据
25+
latest_release=$(echo "$response" | grep \"tag_name\" | grep -v rc | awk 'NR==1{print $2}' | sed -n 's/\"\(.*\)\",/\1/p')
26+
fi
27+
28+
echo "Latest Release: $latest_release" # 打印解析后的结果
29+
ret_val=$latest_release
30+
}
31+
32+
getLatestRelease
1233
- name: Check Install Script KCL Language Server
1334
run: curl -fsSL https://kcl-lang.io/script/install-kcl-lsp.sh | /bin/bash
1435
- name: Check run

0 commit comments

Comments
 (0)