This article explains how to disable a hook in a Bitbucket repository using Command Line Interface (CLI)
Instructions
- With disableHook action, a Pre receive or Post receive Hook in a repository of Bitbucket can be disabled
Refer to the below-given sample action command to disable a hook.
--action disableHook --project "PROJ" --repository "repo-1" --hook "Reject Force Push"
- To check the status of the hook, navigate to Repositories → Repository settings → Hooks. The hook will be disabled as shown in the screenshot below.
It is recommended to test this scenario in a non-production environment or run the action with the --simulate parameter to verify the behavior before deploying.