Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This article explains how to disable a hook in a Bitbucket repository using Command Line Interface (CLI)

Instructions

  1. Using the disableHook action, a pre-receive or post-receive hook can be disabled from a repository of Bitbucket. 

    Code Block
    themeMidnight
    --action disableHook --project "PROJ" --repository "repo-1" --hook "Reject Force Push"

    In above CLI action, 

    • --project value  value refers to Project key, name, or id.

    • --repository value  value refers to Repository to Repository slug, name, or id.
    • --hook value  value refers to Hook to Hook name or key of the form 'plugin key:hook key'.
  2. To check the status of the hook, navigate to Repositories > Repository settings > Hooks. The hook will be is disabled as shown in the screenshot below:
    Image Modified


Info

It is recommended to test this scenario in a non-production environment or run the action with the the --simulate parameter  parameter to verify the behavior before deploying.