git - 如果在功能分支上运行的 Jenkins 作业成功,如何创建 pull 请求

标签 git jenkins pull-request

是否有用于创建 pull 请求的 Jenkins 插件?

假设我在某个功能分支上运行 Jenkins 作业。如果这项工作成功,那么我希望 Jenkins 自动从此功能分支创建 pull 请求。

有一种命令行方式可以创建 pull 请求:

git request-pull [-p] <start> <url> [<end>]

但我一直没能找到让 Jenkins 自动执行任务的方法。

最佳答案

您的 Jenkins 作业可以有一个步骤调用 Atlassian Stash API for creating a pull request

POST /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests?direction&at&state&order&withAttributes&withProperties 

Create a new pull request between two branches. The branches may be in the same repository, or different ones. When using different repositories, they must still be in the same {@link Repository#getHierarchyId() hierarchy}.

The authenticated user must have REPO_READ permission for the "from" and "to" repositories to call this resource.

关于git - 如果在功能分支上运行的 Jenkins 作业成功,如何创建 pull 请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34781993/

相关文章:

android - 首先提交 Android Studio 项目——应该遗漏什么?

eclipse - 为什么 EGit 在新克隆的存储库中显示未暂存的更改?

Git 补丁 - 补丁不适用

Git 指针和 blob

java - Jenkins中的算法协商失败SSH

jenkins - 如何在 Jenkins 管道 View 中显示自定义运行次数

java - Jenkins CI 作业工作区自定义更改

git - 禁用 GitHub 上的 merge 按钮,直到 pull 请求获得批准

github - 在 GitHub 中查找我作为作者、审阅者或受让人的 PR

azure - 防止 Azure Devops CI 管道触发,直到两个人批准拉取请求