将 postman 与 azure devops 同步

sync postman with azure devops

我可以在 azure devops 中成功 运行 postman 测试有没有办法

  1. 创建一个回购“MyCollection”
  2. 运行 获取集合并将其保存到存储库的“Cron”管道?

任何建议

检查这个扩展 Get Postman Scripts,默认情况下它会下载你的邮递员 json 文件并将其保存到 $(Build.ArtifactStagingDirectory),然后我们可以通过 [= 将文件推送到 Azure DevOps 存储库30=]命令。

cd  $(Build.ArtifactStagingDirectory)
git config --global user.name "{email}"
git checkout master
git add .
git commit -m "Sync postman json file to Azure DevOps Repo"
git push https://{PAT}@dev.azure.com/{org name}/{project name}/_git/{repo name}

您还可以查看此 doc 了解更多详情。

更新1

YAML

- task: oneLuckiGetPostmanScripts@1
  displayName: 'Get Postman Script'
  inputs:
    fileLocation: '$(Build.ArtifactStagingDirectory)\Postman'
    apiKey: '{key}'

结果: