Doxabot
GitHub App
Connecting a repository through the Doxa GitHub App and what triggers previews and updates
What the GitHub App does for us
The Doxa GitHub App links Doxa to the GitHub repository we want to document. Once we install it and choose a repository, Doxabot can read that repository's source code and write the first draft of our docs. The same app tells Doxa when a pull request opens or changes, and when new commits reach our production branch, so the docs keep up with the code.
We stay in control of what Doxa can see. The app requests only the repository permissions it needs, and it works only with the repositories we select.
Permissions and events
The app requests four repository permissions. Each one has a specific job:
| Permission | Access | Why Doxa needs it |
|---|---|---|
| Metadata | Read | Identifies the repository we selected. |
| Contents | Read | Reads the source code that Doxabot uses to write docs. |
| Pull requests | Read | Reads pull request changes so Doxa can build a preview. |
| Checks | Write | Creates and updates the documentation preview check on a pull request. |
The app subscribes to two repository events: pull_request and push.
Public repositories:
Doxa does not accept public repositories at the moment, even though the GitHub App can observe them. Connect a private repository.
Connect a repository
If the GitHub App is not installed yet, Doxa asks us to install it first. GitHub then sends us back to Doxa, and we return to the same project to pick the repository.
Open the project and choose Connect a repository
Open a project that does not have a repository yet and choose Connect a repository. The dialog loads the list of repositories that the app can see. The list loads only when we open the dialog.
Install the GitHub App if Doxa asks
If the dialog asks us to install the Doxa GitHub App, follow the GitHub screens. Choose the account or organization, then choose which repositories Doxa can read. When GitHub sends us back, the dialog shows our repositories.
Select the repository
Select the repository we want to document. If another Doxa project already uses that repository, the dialog shows that project next to the repository and does not let us connect it again.
Choose the production branch
Doxa fills in the repository's default branch. To publish docs from a different branch, pick it in the production branch field. Merges into this branch drive the post-merge updates.
Confirm the connection
Confirm the connection in the dialog. Doxa shows a notification with the connected repository name. The first generation then replaces the example pages with pages written from the repository. We can follow it on the Generations page.
One owner per installation:
An installation belongs to the Doxa user who first connected it. If another Doxa user already owns the installation, Doxa answers with a conflict and changes nothing.
Pull request previews
When a pull request opens or is updated, Doxa reads the change and builds a documentation preview for that branch. The preview is reported as a documentation check on the pull request, so we can see the docs the way they will look once published.
Previews do not change the live site. Our published docs stay the same until we publish a version. To learn how branches, previews, and diffs fit together, read Branches and previews.
Updates after a merge
When new commits reach the production branch, for example after a merge, Doxa receives a push event. Doxabot reads the change and updates only the pages the change affects. These updates arrive as a new generation that we review before it goes live.
To guide how Doxabot writes or which pages it touches, set your preferences in Doxabot instructions. When a generation would replace pages that a person wrote or approved, Doxa asks us to review those pages first. See Generation reviews.
Choosing the right repository and branch
Connect the repository that holds the source code the docs describe. Doxabot reads the code, so a repository closer to the product gives a better first draft.
Choose a production branch that holds the code readers should see. Merges into that branch drive post-merge updates.
Use one Doxa project for one repository. A repository already connected to another project cannot be connected again from a second project.