简体   繁体   中英

prevent merge PR in bitbucket

I want to prevent from bitbucket to merge PR if there are not enough approvers. I know that this can be done with the premium user but I don't have one so I am trying to find a workaround.

So I was looking into hooks that might do the trick. However, as fa r as I understand githooks in my repo won't do the trick because they are client hooks. Am I right about it?

Also, I don't have access to the bitbucket server to add their server-side hooks.

can it be done with some webhook using a Jenkins job?
Any helpful reference, tip or other solution are welcome.

As you mentioned you will need one of the following:

Admin user

Admin user will allow you to set up the required approvers在此处输入图片说明

Access to the file system

Also, I don't have access to the bitbucket server to add their server-side hooks.

Once you have access to the filesystem you can add your hooks.

Git hooks

Once more you are right, local git hooks runs on the client-side.

Here is a sample for server-side hook which you will need to use if you was able to pre-receive hook


Trying to manage the PR form Jenkins might work but its a wrong approach since anyone with the right access can merge the PR form within the bitbucket (Web, source tree, cli etc).

Here is one way to do it with Jenkins:
https://mohamicorp.atlassian.net/wiki/spaces/DOC/pages/209059847/Triggering+Jenkins+on+new+Pull+Requests

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM