Bitbucket Cloud currently does not provide a mechanism that allows apps to reject or block a push before it is accepted by the platform.
While Jira Hooks for Bitbucket can receive notifications after a push has occurred, neither the Bitbucket Cloud API nor the Atlassian Forge platform provide a server-side pre-receive hook comparable to the functionality available in Bitbucket Data Center. As a result, an app can react to a push, but it cannot prevent the push from being accepted.
Because of this platform limitation, cloud-side push checks are currently not possible.
Local push validation
To address this limitation, Jira Hooks for Bitbucket provides local push validation through the Validation API and lightweight Git hooks.
Instead of validating pushes inside Bitbucket Cloud, validation is performed directly on the developer machine before the push is sent to Bitbucket.
The local Git hook collects information about the commits that are about to be pushed and submits them to the Validation API. The Process Guardian then evaluates the payload using the same centrally managed rules that are configured in Jira Hooks for Bitbucket.
This approach provides several benefits:
-
Validation happens before changes reach Bitbucket Cloud
-
The same Process Guardian rules are used for local and pull request validation
-
Rule management remains centralized in Jira Hooks for Bitbucket
-
Developers receive immediate feedback in their local workflow
-
Invalid pushes can be blocked locally before they are transmitted
Why not simply implement server-side push checks?
A server-side push check requires support from the hosting platform. In Bitbucket Data Center, this is possible through pre-receive hooks that can reject a push before it is accepted.
Bitbucket Cloud does not currently expose comparable functionality. As a result, no Forge app, Connect app, or external integration can reliably prevent a push from being accepted by Bitbucket Cloud.
Future outlook
If Atlassian introduces a server-side mechanism for blocking pushes in Bitbucket Cloud, Jira Hooks for Bitbucket will evaluate support for cloud-side push checks.
Until such functionality becomes available, local Git hooks provide the earliest and most effective validation point for enforcing push-related compliance requirements.