bitbucket - 通过 API 合并 bitbucket 拉取请求
问题描述
根据Bitbucket API 文档,我应该能够将拉取请求与 POST 合并到此 url:
https://bitbucket.example.com/rest/api/1.0/projects/{projectkey}/repos/{repositoryslug}/pull-requests/{pullrequestid}/merge?version
然而,每当我尝试它时,我都会收到响应409 Conflict
,并且在响应中,它包含以下内容:
"message": "You are attempting to modify a pull request based on out-of-date information.",
"currentVersion": 0,
"expectedVersion": -1,
0
我尝试作为版本号传递,-1
作为版本号,完全省略版本号 - 结果总是一样的。我怎样才能让它合并?
解决方案
事实证明,atlassian API 文档有点错误(或不清楚)。我做的一切都是正确的,但是版本号需要以不同的方式传递。根据文档,格式是
https://.../merge?version
而正确的格式是
https://.../merge?version=<version>
推荐阅读
- python - 列出 python 包中包含的所有文件(相当于 'git ls-files')
- android - Android Studio 无法上网
- typescript - BaseEntity 类字段不被子级继承
- java - Completablefuture 异常处理的问题
- python - python中共享内存的问题没有进入功能
- docker - 无法登录在 gcp 上托管在 docker 中的 neo4j
- html - 您如何使网站标题适合移动浏览器?
- tensorflow - 如何在保持相同形状和尺寸的同时获得 tensorflow 数据集中的最大值?
- alpine.js - 使用 alpine JS 添加和删除 dom 元素
- flutter - 我设计了一个横向和纵向布局不同的页面。旋转设备时无法更改布局