# GitHub

{% hint style="success" %}
If you need to add GitHub source control, please refer to [this page](/on-premise/git-source-control.md).
{% endhint %}

## Configuration

To connect your GitHub, follow the instruction below:

1. On the **Data sources** page, click **Connect**, and select *GitHub* in the Data sources list.
2. Next, select the authentication method - [OAuth2](https://docs.github.com/en/apps/oauth-apps/using-oauth-apps/authorizing-oauth-apps) or [Personal Token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens).
   1. For **OAuth2**, you will first need to create a new OAuth app in GitHub (*Settings* > *Developer Settings*).

<figure><img src="/files/FpIcdNK5LARJBLjBouuE" alt=""><figcaption></figcaption></figure>

Copy the **UI Bakery redirect callback** from the Data source connection page and use it as the **Authorization callback URL** when creating an OAuth app.

Once you've registered the app, go back to UI Bakery - specify your **Client ID** and **Client secret** and define the required permissions in the *Scopes* field. Finally, click **Connect to API** to complete the setup. You will be redirected to the GitHub authorization screen to allow the UI Bakery app.

<figure><img src="/files/RN64O3eRi3KFyqceJnRV" alt=""><figcaption></figcaption></figure>

&#x20;     b. For **Personal Token**, you need to specify your personal GitHub token.

<figure><img src="/files/cu2VVjNMjyvYDSqt68Ce" alt=""><figcaption></figcaption></figure>

3. Click **Test connection** to check whether the data source can be connected, and then click **Connect Datasource** to complete the setup.

## **Usage**

Once you have connected GitHub to UI Bakery, you can start interacting with your data. For this purpose you can use the [Open API request](/reference/working-with-actions/open-api-request.md) action step:

1. Create a new action, select your *GitHub data source* and the *Open API request* action will be selected automatically.\
   All available GitHub endpoints will be defined.
2. Select the required endpoint from the **Operation** dropdown. Set any additional parameters and/or body if necessary.
3. Execute your action.

<figure><img src="/files/LlcuirSNGOPMEQ7ReE70" alt=""><figcaption></figcaption></figure>


---

# 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.uibakery.io/reference/data-sources/github.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.
