# Github

### Pre-requisites

* A Github Account.
* BugBase Company Account with an Active Program.

### Setup

> To setup your Github integration:

1. Navigate to Your **Program Dashboard > Settings > Integrations**.
2. Click `Connect` on the Github Integration Card.
3. Then you will get a prompt for confirmation, then Click `Connect`.
4. Login with your Github account and you will be redirected back to Bugbase.
5. Click on `Complete Setup` on the Github Integration Card.
6. Now Enter your Github username in the **Owner** Field and Select the **Type of Account** you have ( organization or user) and click on `Save Changes`.
7. Select the name of the repository you want to connect to and click on `Save Changes`.
8. Now in the **settings section** select if you want to close the issue on github you created when the corresponding linked report on bugbase is closed.
9. Click `Save Changes`.

***

### How it Works

Now that you have integrated with Github, you can:

* Create a Github issue from your Bugbase report.
* Get two way seamless updates to the issue from Bugbase and vice versa.
* Close the Github issue when the corresponding linked report on bugbase is closed.

### **Creating a Github issue**

Once your GitHub integration has been set up, to create an issue in GitHub from your Bugbase report:

1. Go your `Reports` section and click on the report you want to create an issue for.
2. Click on `Create a Github issue`.
3. Enter Issue title, description (optional) and select an assignee (optional).
4. Click `Create an Issue`.

The Bugbase report will now show as an issue in your GitHub repository.

### Issue Syncing

The following actions in Bugbase will be posted as a comment in your GitHub issue:

* **Comments** : When someone comments on a report, an update will be posted on the associated GitHub issue.
* **Status Change** : When someone changed the status of the report, an update will be posted on the associated GitHub issue.
* **Close Report** : When someone closes a report, an update will be posted on the associated GitHub issue and also the issue gets closed ( optional ).
