git – 如果在功能分支上运行的jenkins作业成功,如何创建拉取请求

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

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

有一种命令行方式来创建拉取请求:

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.

点赞