Skip to content

Commit

Permalink
update sync page
Browse files Browse the repository at this point in the history
  • Loading branch information
zizdlp committed Sep 7, 2024
1 parent 24e1589 commit 99cfd66
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 26 deletions.
16 changes: 4 additions & 12 deletions Features/Synchronization.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,15 @@ jobs:
set -e
# Execute the API request and capture the response
RESPONSE=$(curl -X POST ${{ secrets.ZBOOK_URI }} \
URL="${{ secrets.ZBOOK_URI }}?username=${{ secrets.ZBOOK_USERNAME }}&sync_token=${{ secrets.ZBOOK_SYNC_TOKEN }}&repo_name=${{ secrets.ZBOOK_REPO_NAME }}"
RESPONSE=$(curl -X GET "$URL" \
-H 'Content-Type: application/json' \
-d '{
"repo_name": "${{ secrets.ZBOOK_REPO_NAME }}",
"username": "${{ secrets.ZBOOK_USERNAME }}",
"sync_token": "${{ secrets.ZBOOK_SYNC_TOKEN }}"
}' --max-time 600)
--max-time 600)
# Output the response content
echo "Response: $RESPONSE"
# Check if the response is empty
if [ -z "$RESPONSE" ]; then
echo "Error: Empty response from API"
exit 1
fi
# Check if the response contains the expected status code or key fields
STATUS_CODE=$(echo "$RESPONSE" | grep -oP '(?<="status":)\d+' || echo "200")
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# zbook-user-guide

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)
- 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)

这个仓库是 [zbook](https://github.com/zizdlp/zbook) 的文档仓库,本仓库的 html 渲染见[https://zizdlp.com/workspace/admin/o/docs](https://zizdlp.com/workspace/admin/o/docs)
- 这个仓库是 [zbook](https://github.com/zizdlp/zbook) 的文档仓库,本仓库的 html 渲染见[https://zizdlp.com/workspace/admin/o/docs](https://zizdlp.com/workspace/admin/o/docs)
16 changes: 4 additions & 12 deletions 功能/同步.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,15 @@ jobs:
set -e
# 执行 API 请求并捕获响应
RESPONSE=$(curl -X POST ${{ secrets.ZBOOK_URI }} \
URL="${{ secrets.ZBOOK_URI }}?username=${{ secrets.ZBOOK_USERNAME }}&sync_token=${{ secrets.ZBOOK_SYNC_TOKEN }}&repo_name=${{ secrets.ZBOOK_REPO_NAME }}"
RESPONSE=$(curl -X GET "$URL" \
-H 'Content-Type: application/json' \
-d '{
"repo_name": "${{ secrets.ZBOOK_REPO_NAME }}",
"username": "${{ secrets.ZBOOK_USERNAME }}",
"sync_token": "${{ secrets.ZBOOK_SYNC_TOKEN }}"
}' --max-time 600)
--max-time 600)
# 输出响应内容
echo "Response: $RESPONSE"
# 检查响应内容是否为空
if [ -z "$RESPONSE" ]; then
echo "Error: Empty response from API"
exit 1
fi
# 检查响应中是否包含预期的内容(例如状态码或关键字段)
STATUS_CODE=$(echo "$RESPONSE" | grep -oP '(?<="status":)\d+' || echo "200")
Expand Down

0 comments on commit 99cfd66

Please sign in to comment.