Post-Commit Hooks


Codacy regularly pulls repositories for new updates (commits and pull requests).

For faster analysis, turn on post-commit hooks.

There are two ways to do it: automatically or manually

Automatic setup of Post-Commit Hook


If you are using GitHub or Bitbucket you may let Codacy configure the hook for you. Just go to your project settings and click in the tab Integrations. It should have a switch button for automatic setup of post-commit hooks.

Missing hook automatic setup switch button

It is possible that the switch is not visible to you.
If that is your case just go to the Integrations tab and add GitHub/Bitbucket.
Make sure you also enable it. 

Manual setup of Post-Commit Hook


To turn on post-commit hooks:

  1. Go to your project settings.
  2. Go under Hooks
  3. Copy the key
  4. Go to your version control system (GitHub or Bitbucket)
  5. Paste the key and configure to have 'Application/json'

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

Permissions to create Post-Commit Hooks

If you are having an error when turning on the Post-Commit hook make sure that you have Admin rights on the GitHub project.

Have more questions? Submit a request

2 Comments

  • 0
    Avatar
    Григорий Кислин

    My Post-Commit Hook is switch on, but nothing happened after commit




  • 0
    Avatar
    Codacy Team

    Hi! We sent you an email, so we can take a better look into this. Thank you.

Article is closed for comments.