# Add a project to CodeScan from GitLab

This document guides you through how to add a GitLab project to your CodeScan Cloud account and run the analysis.

1. Log in to your CodeScan account.
2. Once you log in to your [CodeScan](https://www.codescan.io/) account, click on the (**+**) icon in the top-right corner and select **Analyze new project**.

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FWxShDicJGraXyK9hjMF5%2FAnalyzeProzect%205.9.png?alt=media&#x26;token=917e86b6-7cb7-4221-b605-a0421276de8f" alt=""><figcaption></figcaption></figure>

3. This takes you to a different window. Choose the **Organization** for which you'd like to create a project. Click on **Set Up**.

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FL14jGOQ1colDNClFchYX%2FProjectSetup%207.7.png?alt=media&#x26;token=9767ab5b-a7d2-4f53-941f-f6f39390d55f" alt="" width="563"><figcaption></figcaption></figure>

4. On the next screen, click on **Add Analysis Project** button.

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FY0ocm9Iyb4vxO6ZkFtuA%2FAnalysis%20Project%206.1.png?alt=media&#x26;token=a9e13fba-cc69-4302-b0d9-1347dcb454c3" alt=""><figcaption></figcaption></figure>

5. You will now see a new popup window; click on [**GitLab**](https://knowledgebase.autorabit.com/codescan/docs/integrating-codescan-in-gitlab) from the given options.

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2F8kUvGelAxQTh6YCDZuPR%2FGitLab%207.8.png?alt=media&#x26;token=33997c93-3b63-4072-8187-0a10274fd179" alt=""><figcaption></figcaption></figure>

6. Now another popup window appears with the fields: **Choose a repository**, **Project Branch**, **Check Pull Requests**, **Key**, and **Name.**

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FUMe8beG669MtmotgXwD4%2FGitAnalysis.png?alt=media&#x26;token=b793c94f-227f-4118-88fc-fd3831ec3108" alt="" width="375"><figcaption></figcaption></figure>

* Choose the repository you want to add, followed by the project branch name.
* Make sure you select the checkbox under **Check Pull Requests**. This will add **webhooks**.
* Next, enter the **Project Key** followed by the **Project Name**.
* Once you fill out all the details in the popup window, click on **Add and Run Now**.

{% hint style="info" %}
**Note:** To find the project key, refer to our document [HERE](https://knowledgebase.autorabit.com/codescan/docs/finding-your-project-key).
{% endhint %}

7. This triggers the project analysis and the project being added under your CodeScan organization.
8. You can view the project analysis report by clicking on **CodeScan** from your VC repository.

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2Fx08RAkhSg7ZiQobGqkce%2FGitLabAnalysis.png?alt=media&#x26;token=b784ebf4-b5a3-41d7-a33c-45511de95b36" alt=""><figcaption></figcaption></figure>

9. When you click the link, it will take you to the **CodeScan Project** page, where you can view your project analysis report.

<figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FreTIzB9yJpRzJtyi6vjC%2FGit%20Analysis%207.4.png?alt=media&#x26;token=6fbe2fc5-821e-4a1d-9283-3d5c9979e7f4" alt=""><figcaption></figcaption></figure>

Now that the webhooks have been created, every time a push or pull request is made to the tracked branch, an analysis will be triggered in CodeScan.
