Skip to main content
All CollectionsCode Review Automation
Monitor your code with automatic reviews
Monitor your code with automatic reviews

Use webhooks to trigger code reviews automatically

Gabriele Gallo Stampino avatar
Written by Gabriele Gallo Stampino
Updated over a week ago

Clayton helps you keep your code quality under control automatically by monitoring and reviewing your code when it changes in your repository.

Webhooks in your version control system, let Clayton listen to specific Git events and trigger reviews in real-time (ref. How the Clayton code reviews work).


How to enable automated code reviews

Clayton creates webhooks automatically to monitor relevant events in your repository. To set up the automation, please do the following steps:

  1. Log in to Clayton

  2. Go to your project page

  3. Click on Settings > Protection

  4. Click Change and choose a protection mode

  5. On the More options section, configure when triggering a new PR scan and when amending the previous review

  6. Click Apply


In-line comments published on each issue detected in PR


Multiple status checks in GitHub

Protection mode behaviours

Mode

Description

When to use?

Observe discretely

Collect insights without interfering with developers.

Audits over a period of time

Make suggestions

Oversee developments and suggest changes to Pull Requests when relevant.

  • Addressing any issues is optional.

  • No need to comply with standards yet

  • Trying out Clayton the first time

Protect what's new

Oversee developments and request changes to Pull Requests if needed. Addressing issues with legacy code is optional.

  • Comply with standards moving forward

  • Best for long-running projects

  • Best when technical debt is not a priority

Full compliance

Oversee developments and request changes to Pull Requests if needed. Addressing issues with legacy code is required.

  • Comply with standards fully

  • Best for new applications

  • Best for rigorous teams

PRO TIP: Don't forget to configure the settings in the More Options section to make sure never to miss a review:

  • Scan PRs only when the destination is a tracked branch: By default, we review all Pull Requests, regardless of the branch they target. This setting restricts automated reviews to only your tracked branches.

  • Amend PR reviews only when issues change: By default, we amend PR reviews on your source control provider anytime new commits are pushed to the head branch. With this setting, we amend PR reviews only when issues are added or fixed.

  • Inline comments

    • On: All inline comments.

    • Limited: Up to 20 inline comments with the Scan Summary.

    • Off: Scan Summary with no inline comments.

Scan Summary


Track your branches

Please note that only pull requests created towards branches that are tracked in Clayton are reviewed automatically. Make sure to track all your integration branches to protect every new development and enforce best practices at earlier stages.

Quality Gate

Do you want to create a quality gate for your projects with Clayton?
Have a look at our dedicated Help Section to learn how to make sure that newly committed code doesn't introduce problems.

Did this answer your question?