You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在Azure Pipelines中使用SwaggerHub CLI实现PowerShell同款操作

问题:在Azure Pipelines中实现SwaggerHub配置与API文档更新

手动操作方式

原本通过以下PowerShell命令手动完成SwaggerHub配置及API文档更新:

PS C:\PathI> 
swaggerhub configure
? SwaggerHub URL: https://api.swaggerhub.com
? API Key: "my key value"
swaggerhub api:update "X/AsyncSpec/3.0.0" -f "path.yaml"

尝试的Azure Pipelines脚本

现希望在Azure Pipelines中实现相同操作,编写了如下脚本,需要确保该脚本能够完成SwaggerHub配置和API文档更新两个步骤:

- script: |
    cd "path"
    swaggerhub configure
    https://api.swaggerhub.com
    $(SWAGGERHUB_API_KEY)
    swaggerhub api:update x/AsyncSpec/3.0.0 -f "path.yaml"
  displayName: 'Update API documentation'

内容的提问来源于stack exchange,提问作者Chevalier sombre JVC 18-25

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.19 08:42:02