Skip to content

Commit 99cfd66

Browse files
committed
update sync page
1 parent 24e1589 commit 99cfd66

File tree

3 files changed

+10
-26
lines changed

3 files changed

+10
-26
lines changed

Features/Synchronization.md

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,15 @@ jobs:
2626
set -e
2727
2828
# Execute the API request and capture the response
29-
RESPONSE=$(curl -X POST ${{ secrets.ZBOOK_URI }} \
29+
URL="${{ secrets.ZBOOK_URI }}?username=${{ secrets.ZBOOK_USERNAME }}&sync_token=${{ secrets.ZBOOK_SYNC_TOKEN }}&repo_name=${{ secrets.ZBOOK_REPO_NAME }}"
30+
31+
RESPONSE=$(curl -X GET "$URL" \
3032
-H 'Content-Type: application/json' \
31-
-d '{
32-
"repo_name": "${{ secrets.ZBOOK_REPO_NAME }}",
33-
"username": "${{ secrets.ZBOOK_USERNAME }}",
34-
"sync_token": "${{ secrets.ZBOOK_SYNC_TOKEN }}"
35-
}' --max-time 600)
33+
--max-time 600)
3634
3735
# Output the response content
3836
echo "Response: $RESPONSE"
3937
40-
# Check if the response is empty
41-
if [ -z "$RESPONSE" ]; then
42-
echo "Error: Empty response from API"
43-
exit 1
44-
fi
45-
4638
# Check if the response contains the expected status code or key fields
4739
STATUS_CODE=$(echo "$RESPONSE" | grep -oP '(?<="status":)\d+' || echo "200")
4840

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# zbook-user-guide
22

3-
This repository is the documentation repository for [zbook](https://github.com/zizdlp/zbook). The HTML rendering of this repository can be viewed at: [https://zizdlp.com/workspace/admin/o/docs](https://zizdlp.com/workspace/admin/o/docs)
3+
- This repository is the documentation repository for [zbook](https://github.com/zizdlp/zbook). The HTML rendering of this repository can be viewed at: [https://zizdlp.com/workspace/admin/o/docs](https://zizdlp.com/workspace/admin/o/docs)
44

5-
这个仓库是 [zbook](https://github.com/zizdlp/zbook) 的文档仓库,本仓库的 html 渲染见[https://zizdlp.com/workspace/admin/o/docs](https://zizdlp.com/workspace/admin/o/docs)
5+
- 这个仓库是 [zbook](https://github.com/zizdlp/zbook) 的文档仓库,本仓库的 html 渲染见[https://zizdlp.com/workspace/admin/o/docs](https://zizdlp.com/workspace/admin/o/docs)

功能/同步.md

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,15 @@ jobs:
2626
set -e
2727
2828
# 执行 API 请求并捕获响应
29-
RESPONSE=$(curl -X POST ${{ secrets.ZBOOK_URI }} \
29+
URL="${{ secrets.ZBOOK_URI }}?username=${{ secrets.ZBOOK_USERNAME }}&sync_token=${{ secrets.ZBOOK_SYNC_TOKEN }}&repo_name=${{ secrets.ZBOOK_REPO_NAME }}"
30+
31+
RESPONSE=$(curl -X GET "$URL" \
3032
-H 'Content-Type: application/json' \
31-
-d '{
32-
"repo_name": "${{ secrets.ZBOOK_REPO_NAME }}",
33-
"username": "${{ secrets.ZBOOK_USERNAME }}",
34-
"sync_token": "${{ secrets.ZBOOK_SYNC_TOKEN }}"
35-
}' --max-time 600)
33+
--max-time 600)
3634
3735
# 输出响应内容
3836
echo "Response: $RESPONSE"
3937
40-
# 检查响应内容是否为空
41-
if [ -z "$RESPONSE" ]; then
42-
echo "Error: Empty response from API"
43-
exit 1
44-
fi
45-
4638
# 检查响应中是否包含预期的内容(例如状态码或关键字段)
4739
STATUS_CODE=$(echo "$RESPONSE" | grep -oP '(?<="status":)\d+' || echo "200")
4840

0 commit comments

Comments
 (0)