> For the complete documentation index, see [llms.txt](https://docs.xygeni.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xygeni.io/getting-started/quick-start-with-your-code-repository.md).

# Quick start with your SCM

Use the **Manage Scans** option to automatically connect to a repository in your SCM tool and run scans from the Xygeni platform.

You can start with GitHub, GitLab, Azure or Bitbucket.

### Open Manage Scans

Go to **Home → Manage Scans**.

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-9463e1f78cadce52410a6dc34f852cfcbf1839c9%2Fimage.png?alt=media" alt=""><figcaption></figcaption></figure>

Click **Add Repository**.

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2FF9iUEEb23uDO9C8YndMT%2Fimage.png?alt=media&amp;token=abf7b4d4-995d-49e4-8b75-db172f9b3274" alt=""><figcaption></figcaption></figure>

### Connect a GitHub repository

Select **GitHub** to install the **Xygeni GitHub Application**.

Choose the installation scope. You can install it for a user or an organization.

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2FwPUqE4InXdB6xMoFR6wv%2Fimage.png?alt=media&amp;token=2cf2717b-acc3-41a4-9406-cd479ce5b7f9" alt="" width="349"><figcaption></figcaption></figure>

Choose whether Xygeni can access all repositories or only selected repositories.

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2FeqYYlvJYddm8PNOgxEWs%2Fimage.png?alt=media&amp;token=d9c70898-dd62-4f3e-a70b-897dbea651de" alt="" width="320"><figcaption></figcaption></figure>

Click **Install & Authorize**. Xygeni adds the integration and lists the repositories it can access.

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2Fgit-blob-32e8ebec0cc9b8b9f2682065cf81082f8ac4a43d%2FScreenshot%202025-04-04%20105058.png?alt=media" alt=""><figcaption></figcaption></figure>

Click **Scan Now** for the repository you want to scan.

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2FniFYAnmqURyRMRKK2YRz%2Fimage.png?alt=media&amp;token=6496346e-781f-4f37-a0e1-e9838e09f138" alt=""><figcaption></figcaption></figure>

Xygeni starts a GitHub workflow for that scan.

<figure><img src="https://4096647782-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FUTz59rJLkJBjiRWAMknU%2Fuploads%2FbduBzx4ymsAZSMUxGCHF%2Fimage.png?alt=media&amp;token=f3b06634-227f-4e44-abf6-8eebb597cfee" alt=""><figcaption></figcaption></figure>

After the scan finishes, results appear in the [Dashboard](/introduction-to-xygeni/xygeni-web-ui-overview/dashboard.md). The project name matches the repository name.

You can also enable notifications. See [Notifications](/xygeni-administration/platform-administration/notifications.md).

### Connect a GitLab repository

#### 1. Create the integration

1. Go to **Manage Scans**.
2. Click **Add Repository**.
3. Select **GitLab**.
4. Enter a Personal Access Token with these scopes:
   * `api`
   * `read_repository`
   * `write_repository`
5. Select the group you want to onboard.
6. Click **Configure**.

Ensure the Gitlab token belongs to a user with sufficient permissions/right role. Also, pipeline variable permissions should be set accordingly. Otherwise, this might lead to a configuration failure being displayed.

#### 2. Let Xygeni prepare the pipeline

Click **Scan Now** for the repository you want to scan.

Xygeni configures the repository based on the default branch settings:

* If the default branch is not protected, Xygeni commits the pipeline files directly.
* If the default branch is protected, Xygeni creates a setup merge request.

#### 3. Review the setup merge request for protected branches

If GitLab creates a setup merge request, review and merge it before the first scan runs.

1. Open the setup merge request in GitLab.
2. Review the new files:
   * `.xygeni-scan-ci.yml`
   * `.xygeni-scan-now-ci.yml`
3. Review the new `include` block in `.gitlab-ci.yml`:

```yaml
include:
  - local: '.xygeni-scan-ci.yml'
  - local: '.xygeni-scan-now-ci.yml'
    rules:
      - if: $XYGENI_SCAN_NOW == 'true'
```

4. Confirm that `XYGENI_TOKEN` exists under **Settings → CI/CD → Variables**.
5. Approve the merge request if your project requires approvals.
6. Merge the setup merge request.

#### 4. Run the first scan

When the repository status changes to **Ready**, click **Scan Now** again.

### Run scans

Manage Scans supports three scan modes for connected repositories.

#### Run a scan now

1. Open **Manage Scans**.
2. Find the repository.
3. Click **Scan Now**.

Xygeni triggers a pipeline on the default branch. Results appear in the dashboard a few minutes later.

#### Schedule a daily scan

1. Open **Manage Scans**.
2. Find the repository.
3. Click **Scheduled Scan**.
4. Select the daily run time.
5. Save the schedule.

Xygeni runs the scan automatically at the selected time.

#### Scan on merge requests or pull requests

1. Open **Manage Scans**.
2. Find the repository.
3. Click **Scan on MR/PR**.

Xygeni runs a scan for new or updated merge requests or pull requests that target the default branch.

{% hint style="info" %}
For more details and additional options, see [Manage Scans](/xygeni-products/scan-management/managed-scans.md).
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.xygeni.io/getting-started/quick-start-with-your-code-repository.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
