Restricting hook execution

Important

Helix TeamHub has a new way to add and manage webhooks. The existing Hooks feature is still available in the left navigation pane, but will be deprecated in the future. To add new webhooks that notify external services when new commits are pushed to a repository, use the Webhooks feature instead. To learn more, see Webhooks.

TeamHub executes all active webhooks by default. You can restrict the execution of repository hooks by using case-insensitive regular expressions on reference and path. When set, the hook executes only if the reference pattern matches a branch or a bookmark, and/or if any of the changed paths matches the path pattern.

For examples, to execute a hook only:

  • When main or develop branches are updated:

    Set reference pattern as ^(main|develop)$ and leave path pattern empty.

  • When javascript files are changed:

    Leave reference pattern empty and set path pattern as .*\.js$.

  • On feature branches changing paths matching tests:

    Set reference pattern as ^feature and path pattern as tests.