Skip to content
This documentation applies to Codacy Self-hosted v4.3.0

For the latest updates and improvements, see the latest Cloud documentation instead.

Post-commit hooks#

For Codacy to check updates in your repository (new commits and pull requests) you must have post-commit hooks enabled.

There are two ways to do this: automatically or manually

Automatic setup of post-commit hook#

If you're using GitHub or Bitbucket you can let Codacy configure the hook for you. Go to your repository settings and click on the Integrations tab. There should be a switch button for the automatic setup of post-commit hooks.

Missing hook automatic setup switch button#

If the switch isn't visible, go to the Integrations tab and add the GitHub or Bitbucket integration.

Important

Make sure that you enable the integration after adding it.

Adding an integration

Manual setup of post-commit hooks on GitHub#

To turn on post-commit hooks for GitHub:

  1. Copy the hook URL to your clipboard.
  2. Go to Webhooks & Services under your repository settings.
  3. Paste the hook URL into the field Payload URL.
  4. Select application/json in the field Content Type.
  5. Click Add Webhook.

Here's an example of how to configure your hooks on GitHub:

Configuring a hook on GitHub

Why can't I configure post-commit hooks and integrations?#

Have you added your repository manually (via URL)? In that case, Codacy won't allow the integration to be added, causing the issue with post-commit hooks. To get this sorted, you will have to remove your repository and re-add it under a synced organization.

If you get an error when turning on the post-commit hook, please make sure that you have Admin rights on the GitHub repository.

If you're still unable to configure the integration, please contact us at support@codacy.com.

Share your feedback 📢

Did this page help you?

Thanks for the feedback! Is there anything else you'd like to tell us about this page?

We're sorry to hear that. Please let us know what we can improve:

Alternatively, you can create a more detailed issue on our GitHub repository.

Thanks for helping improve the Codacy documentation.

If you have a question or need help please contact support@codacy.com.

Last modified September 8, 2021