fix: CI工作流去掉jq依赖,改用python3解析JSON
Some checks failed
Release Docs / release (push) Failing after 6s

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
杨柳杰
2026-05-04 17:36:53 +08:00
parent 8811dee333
commit 8b9247291b

View File

@@ -22,7 +22,7 @@ jobs:
echo "$TAG" > "docs/.version" echo "$TAG" > "docs/.version"
tar -czf /tmp/docs.tar.gz docs/ tar -czf /tmp/docs.tar.gz docs/
- name: Create Release - name: Create Release and Upload
env: env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
run: | run: |
@@ -39,13 +39,13 @@ jobs:
\"body\": \"米普云航司API文档更新 ${TAG}\" \"body\": \"米普云航司API文档更新 ${TAG}\"
}" }"
# Get release ID # Get release ID via python (no jq dependency)
RELEASE_ID=$(curl -sf "${API}/releases/tags/${TAG}" \ RELEASE_ID=$(curl -sf "${API}/releases/tags/${TAG}" \
-H "Authorization: token ${GITEA_TOKEN}" \ -H "Authorization: token ${GITEA_TOKEN}" \
| jq -r '.id') | python3 -c "import sys,json; print(json.load(sys.stdin)['id'])")
if [ -z "$RELEASE_ID" ] || [ "$RELEASE_ID" = "null" ]; then if [ -z "$RELEASE_ID" ] || [ "$RELEASE_ID" = "None" ]; then
echo "Error: failed to create release" echo "Error: failed to get release ID"
exit 1 exit 1
fi fi