Open nickbroon opened 3 years ago
@nickbroon Hi, this is already supported since you can configure Triggers in the Bitbucket admin panel.
Doc: https://external-hooks.reconquest.io/docs/triggers/
Screenshot:
This way a merge check will be called twice, but the calls will have different environment variables.
Let's say I merge to release branch and expect to see my changes in development branch too:
Hooks triggered by pull requests have:
BB_HOOK_TRIGGER_ID=pull-request-merge
BB_FROM_REF=source-branch
BB_TO_REF=release-branch
Hooks triggered by automatic merge have:
BB_HOOK_TRIGGER_ID=merge
BB_FROM_REF=release-branch
No BB_PULL_REQUEST_* variables will be available
BB_TO_REF=development-branch
Also, BB_*_HASH
variables will have different values. Other variables will have the same value.
BB_IS_DRY_RUN
will be false
.
Let me know if it works for you or no.
Hi @kovetskiy, does enabling the Internal Merge Event under Post-receive Triggers help with triggering a post-receive hook after an automatic merge is performed by Bitbucket?
Our workflow could be simplified as follows:
master
branch
1.1. feature/X
created from master
1.2. release/Y
created from master
feature/X
merged to release/Y
-> Bitbucket automatic merge from release/Y
to master
master
to develop
At this moment, even though the Internal Merge Event under Post-receive Triggers is enabled (as seen in the screenshot above) no event is received by the post-receive hook script. Normal commit or merge events, not done by Bitbucket automatic merge, are received as expected.
Thanks in advance.
As well as the existing support for
RepositoryPushHookRequest
andPullRequestMergeHookRequest
adding support forMergeHookRequest
so that external scripts can be called when thing like automatic branch merging is configured.https://developer.atlassian.com/server/bitbucket/how-tos/hooks-merge-checks-guide/#choosing-hook-trigger-s-