# PR Checks

Use Snyk PR Checks to prevent new security issues from entering your codebase by automatically scanning code changes in real-time as soon as you submit a pull request (PR) in your source code manager (SCM).

## Why use PR Checks

| Benefits                                      | Details                                                                                                                                                                    |
| --------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Automatically scanned pull request            | Scan code changes in real-time as soon as a pull request is submitted, to catch potential issues before they go into production.                                           |
| Results displayed in your source code manager | Make use of security reviews and notes left by Snyk on your pull requests.                                                                                                 |
| Code change testing for security issues       | Test changes to your codebase for any security issues, ensuring that your code stays secure over time.                                                                     |
| Branch testing                                | Test branches before and after implementing changes to fail only if the new branch has introduced issues. Prevention of merging pull requests with failed security issues. |

## What to test for

You can analyze PR Checks results in your SCM to test for dependency and licensing issues using [Snyk Open Source](https://docs.snyk.io/~/changes/m2hJeDrttXy2N83AnRjM/scan-application-code/snyk-open-source), and code security using [Snyk Code](https://docs.snyk.io/~/changes/m2hJeDrttXy2N83AnRjM/scan-application-code/snyk-code).

## How PR checks work

The following diagram explains how Snyk Checks PRs in your development workflow.

<figure><img src="https://2533899886-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MdwVZ6HOZriajCf5nXH%2Fuploads%2Fgit-blob-3938dc3a826390a69e171169ee7527352b660272%2FScreenshot%202022-09-20%20at%2011.27.44.png?alt=media" alt="Diagram showing where Snyk checks for pull requests in the development workflow."><figcaption><p>Pull request checks in the development workflow</p></figcaption></figure>

**Step-by-step process**

1. A developer creates a pull request (PR) in an SCM integrated with Snyk.
2. Snyk automatically scans the code changes in the PR for issues.
3. Snyk leaves security reviews and notes on the PR.
4. The developer can view the PR Checks results and fix identified issues before merging the code.
5. The PR Checks results appear as **Passed** or **Failed** directly in the SCM, preventing PRs from being merged with security issues.

## What's next?

* [Configure PR Checks](https://docs.snyk.io/~/changes/m2hJeDrttXy2N83AnRjM/scan-application-code/run-pr-checks/configure-pr-checks)
* [Analyze PR Checks results](https://docs.snyk.io/~/changes/m2hJeDrttXy2N83AnRjM/scan-application-code/run-pr-checks/pr-checks-results)
* [Troubleshooting](https://docs.snyk.io/~/changes/m2hJeDrttXy2N83AnRjM/scan-application-code/run-pr-checks/troubleshooting)
