# Configuration files

To run analyses in TrustInSoft CI, a configuration is required for the GitHub repository to analyze. This configuration can:

* either be written in the Project settings page (in the `Build configuration` section) (and is called a **Global configuration**),
* or be committed with files in the GitHub repository inside a `.trustinsoft/` directory at the root of the repository (and is called a **Committed configuration**).

This configuration includes:

* the optional [Build preparation stage](/configuration-file/build-preparation-script.md), to prepare the repository to be analyzed,
* and the required [Analyses configuration](/configuration-file/analyses-configuration-file.md), to describe the list of analyses.

While set-upping a project, you will have to chose between using a **Global configuration** (written in the Project settings page) or a **Committed configuration** (committed in the `.trustinsoft/`directory of the GitHub repository), according to the following advantages and disadvantages:

|                                                  Global configuration                                                 |                                                                                           Committed configuration                                                                                           |
| :-------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|                            :heavy\_plus\_sign: Easy set-up without updating your repository                           |                                                                 :heavy\_minus\_sign: Requires to modify your repository by committing files                                                                 |
|                          :heavy\_plus\_sign: Common to all branches, tags, and pull requests                          |                                                          :heavy\_plus\_sign: Each branch, tag or pull request can have its own unique configuration                                                         |
| :heavy\_minus\_sign: Replaying a build will use the current global configuration (and not the one used for the build) |                                                        :heavy\_plus\_sign: Replaying a build will use the same configuration of the associated commit                                                       |
|                                                                                                                       | :heavy\_plus\_sign: The [Analyses configuration](/configuration-file/analyses-configuration-file.md) can be generated during the [Build preparation stage](/configuration-file/build-preparation-script.md) |

{% hint style="info" %}
In simple words, if you need to have a different configuration for several branches, tags or pull requests, a C**ommitted configuration** should be chosen. Otherwise, a **Global configuration** should be enough to set-up your project.
{% endhint %}

{% hint style="warning" %}
A single *project* can use both a **Global configuration** and a **Committed configuration**.

In this case, when a build is run, if a `.trustinsoft/`directory exists for the commit associated to this build, then the **Committed configuration** is used (and the **Global configuration** is completely ignored). Otherwise the **Global configuration** is used.

A single *build* cannot used a mixed of a **Global configuration** and a **Committed configuration**.
{% endhint %}

{% hint style="success" %}
Each build indicates whether it is using a **Global configuration** or a **Committed configuration**.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ci.trust-in-soft.com/configuration-file.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
