mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-13 00:10:27 +00:00
fix(ci): 修复 Update apifox 步骤中因 OpenAPI 文件过大导致的参数列表过长错误
This commit is contained in:
17
.github/workflows/release.yml
vendored
17
.github/workflows/release.yml
vendored
@@ -458,24 +458,23 @@ jobs:
|
|||||||
pnpm i
|
pnpm i
|
||||||
pnpm run build:openapi
|
pnpm run build:openapi
|
||||||
|
|
||||||
# 读取并压缩 openapi.json 内容
|
# 使用 jq 安全地构建大型 JSON 数据并保存到文件
|
||||||
OPENAPI_CONTENT=$(cat packages/napcat-schema/dist/openapi.json | tr -d '\n\r\t' | sed 's/ */ /g' | sed 's/"/\\"/g')
|
jq -n --rawfile input packages/napcat-schema/dist/openapi.json \
|
||||||
|
'{
|
||||||
# 构建 JSON 数据
|
input: $input,
|
||||||
JSON_DATA=$(printf '{
|
options: {
|
||||||
"input": "%s",
|
|
||||||
"options": {
|
|
||||||
"endpointOverwriteBehavior": "OVERWRITE_EXISTING",
|
"endpointOverwriteBehavior": "OVERWRITE_EXISTING",
|
||||||
"schemaOverwriteBehavior": "OVERWRITE_EXISTING",
|
"schemaOverwriteBehavior": "OVERWRITE_EXISTING",
|
||||||
"updateFolderOfChangedEndpoint": true,
|
"updateFolderOfChangedEndpoint": true,
|
||||||
"moduleId": 1140714,
|
"moduleId": 1140714,
|
||||||
"deleteUnmatchedResources": true
|
"deleteUnmatchedResources": true
|
||||||
}
|
}
|
||||||
}' "$OPENAPI_CONTENT")
|
}' > apifox_payload.json
|
||||||
|
|
||||||
|
# 通过文件形式发送数据,避免命令行长度限制
|
||||||
curl --location -g --request POST 'https://api.apifox.com/v1/projects/5348325/import-openapi?locale=zh-CN' \
|
curl --location -g --request POST 'https://api.apifox.com/v1/projects/5348325/import-openapi?locale=zh-CN' \
|
||||||
--header 'X-Apifox-Api-Version: 2024-03-28' \
|
--header 'X-Apifox-Api-Version: 2024-03-28' \
|
||||||
--header "Authorization: Bearer $APIFOX_TOKEN" \
|
--header "Authorization: Bearer $APIFOX_TOKEN" \
|
||||||
--header 'Content-Type: application/json' \
|
--header 'Content-Type: application/json' \
|
||||||
--data-raw "$JSON_DATA"
|
--data-binary @apifox_payload.json
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user