Installing Our Webhook

After adding a repository to your Dashboard, we highly recommend you install our webhook. This hook is what notifies us of certain events happening in your repository, including commits made to your default branch. When we receive the notification, we'll run a new analysis on the spot.

Beanstalk

Bitbucket

GitHub

GitLab

🚧

If you find yourself triggering an analysis manually on a regular basis, this usually indicates that our webhook is either missing broken.

If you don't install our webhook, we'll check for new commits on a poll.

You must be in an organization's Owners group to perform the actions described in this article.

Beanstalk

  1. From your Beanstalk repository's Activity page, click Settings.
156
  1. Click Integration.
305
  1. Scroll down and click Webhooks Classic.
373
  1. Click Activate integration.
389
  1. Paste your repository's Code Climate API endpoint URL into the URL field.
  2. Click Next Step.
507
  1. Click Activate. Your Beanstalk repository will now trigger a new analysis automatically each time you push a commit to your default branch.
490

Bitbucket

  1. From your Bitbucket repository's Overview page, click Settings in the left navigation.
372
  1. Under Integrations click Webhooks.
325
  1. Click Add Webhook.
862
  1. Enter a Title, you can name it anything you want (i.e. Code Climate Hook).
  2. Paste the following into the URL field: https://codeclimate.com/api/repos/repo_id/refresh?api_token=api_token.
    In this URL:
  • Replace repo_id with the ID listed in the browser's URL bar when viewing the repository The Feed Page page.
  • Replace api_token with the token listed in the organization's Settings menu, in the Integrations tab. When looking for this token, ensure you are not viewing a repository’s Integrations tab -- since API tokens live at the organization-level, it is accessed in your organization’s Integrations tab.
619

🚧

Ensure that the webhook's status is checked as "Active". It's important to note that, we currently do not support any Triggers listed other than Repository Push.

  1. Click Save. Your Bitbucket repository will now trigger a new analysis automatically each time you push a commit to your default branch.

GitHub

📘

If you've added your repository using our streamlined method we'll automatically install our webhook for you. For repositories that were added manually, follow the steps below to install our webhook.

  1. In GitHub, go to Settings > Webhooks & Services, for your repo.
  2. Add a webhook to send an event to Code Climate each time you open a PR. The webhook URL will be: https://codeclimate.com/webhooks
821

🚧

As shown in the screenshot above, when selecting the desired scopes, make sure to check "Send me everything". Also make sure the "Active" box is selected.

  1. Click Add webhook. Your GitHub repository will now trigger a new analysis automatically each time you push a commit to your default branch.

GitLab

  1. From your GitLab repository's Project page, click Settings.
212
  1. Click Web Hooks.
202
  1. Paste your repository's Code Climate API endpoint URL into the URL field.
  2. Ensure the default settings are checked.
  3. Click Add Web Hook. Your GitLab repository will now trigger a new analysis automatically each time you make a commit to your default branch.
532