You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/user/reference/git-integration.rst
+156Lines changed: 156 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -229,3 +229,159 @@ depending on where the project you are trying to access has permissions from.
229
229
.. seealso:: GitHub doc on `requesting access to your organization OAuth`_ for step-by-step instructions.
230
230
231
231
.. _requesting access to your organization OAuth: https://docs.github.com/en/github/setting-up-and-managing-your-github-user-account/managing-your-membership-in-organizations/requesting-organization-approval-for-oauth-apps
232
+
233
+
GitHub App
234
+
----------
235
+
236
+
.. warning::
237
+
238
+
Our GitHub App is currently in beta, see our `blog post <https://about.readthedocs.com/blog/2025/06/welcome-to-our-beta-github-app/>`__ for more information.
239
+
240
+
We are in the process of migrating our GitHub OAuth application to a `GitHub App <https://docs.github.com/en/apps/overview>`__.
241
+
We have two GitHub Apps, one for each of our platforms:
242
+
243
+
- `Read the Docs Community <https://github.com/apps/read-the-docs-community>`__
244
+
- `Read the Docs Business <https://github.com/apps/read-the-docs-business>`__
245
+
246
+
Features
247
+
~~~~~~~~
248
+
249
+
When using GitHub, Read the Docs uses a GitHub App to interact with your repositories.
250
+
This has the following benefits over using an OAuth application:
251
+
252
+
- More control over which repositories Read the Docs can access.
253
+
You don't need to grant access to all your repositories in order to create an account or connect a project to a single repository.
254
+
- No need to create webhooks on your repositories.
255
+
The GitHub App subscribes to all required events when you install it.
256
+
- No need to create a deploy key on your repository (|com_brand| only).
257
+
The GitHub App can clone your private repositories using a temporal token.
258
+
- If the original user who connected the repository to Read the Docs loses access to the project or repository,
259
+
the GitHub App will still have access to the repository.
260
+
- You can revoke access to the GitHub App at any time from your GitHub settings.
261
+
- Never out of sync with changes on your repository.
262
+
The GitHub App subscribes to all required events and will always keep your project up to date with your repository.
263
+
264
+
Adding a project from a repository
265
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
266
+
267
+
To add a project from a repository,
268
+
you need to install the Read the Docs GitHub App and grant access to that repository.
269
+
270
+
- `Read the Docs Community <https://github.com/apps/read-the-docs-community/installations/new/>`__
271
+
- `Read the Docs Business <https://github.com/apps/read-the-docs-business/installations/new/>`__
272
+
273
+
Once you have installed the GitHub App, click on the :guilabel:`Projects` tab, and click on :guilabel:`Add project`,
274
+
search for the repository you want to create a project for, and then follow the instructions from there.
275
+
276
+
Connect a repository to an existing project
277
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
278
+
279
+
In case you manually added a project on Read the Docs,
280
+
or if you want to connect your project to a different repository,
281
+
you need to install the Read the Docs GitHub App and grant access to the repository you want to connect.
282
+
283
+
- `Read the Docs Community <https://github.com/apps/read-the-docs-community/installations/new/>`__
284
+
- `Read the Docs Business <https://github.com/apps/read-the-docs-business/installations/new/>`__
285
+
286
+
Once you have installed the GitHub App, go the :guilabel:`Settings` page of the project,
287
+
and select the repository you want to connect from the :guilabel:`Connected repository` dropdown.
288
+
289
+
Manually migrating a project
290
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
291
+
292
+
We recommend using the migration page to migrate your projects from the old OAuth application to the new GitHub App.
293
+
294
+
- `Read the Docs Community <https://app.readthedocs.com/accounts/migrate-to-github-app/>`__
295
+
- `Read the Docs Business <https://app.readthedocs.com/accounts/migrate-to-github-app/>`__
296
+
297
+
But in case you need to manually migrate a project,
298
+
you can follow these steps:
299
+
300
+
- Go to the :guilabel:`Settings` page of your Read the Docs project,
301
+
and click on :guilabel:`Integrations`, and delete all the integrations that are listed there.
302
+
- Go to the settings page of your GitHub repository,
303
+
click on :guilabel:`Webhooks`, and delete all the webhooks with URLs that start with:
304
+
305
+
- ``https://readthedocs.org/api/v2/webhook/<your-project-slug>`` or ``https://app.readthedocs.org/api/v2/webhook/<your-project-slug>`` for Read the Docs Community.
306
+
- ``https://readthedocs.com/api/v2/webhook/<your-project-slug>`` or ``https://app.readthedocs.com/api/v2/webhook/<your-project-slug>`` for Read the Docs Business.
307
+
308
+
- For projects using Read the Docs Business,
309
+
go to the settings page of your GitHub repository,
310
+
click on :guilabel:`Deploy keys`, and delete the deploy with a title matching the format ``[email protected] (<your-project-slug>)``.
311
+
- :ref:`Connect the project to the repository <reference/git-integration:Connect a repository to an existing project>`.
312
+
313
+
Revoking access
314
+
~~~~~~~~~~~~~~~
315
+
316
+
.. warning::
317
+
318
+
If you revoke access to the GitHub App with any of the methods below,
319
+
all projects linked to that repository will stop working,
320
+
but the projects and its documentation will still be available.
321
+
If you grant access to the repository again,
322
+
you will need to :ref:`manually connect your project to the repository <reference/git-integration:Connect a repository to an existing project>`.
323
+
324
+
You can revoke access to the Read the Docs GitHub App at any time from your GitHub settings.
325
+
326
+
- `Read the Docs Community <https://github.com/apps/read-the-docs-community/installations/new/>`__
327
+
- `Read the Docs Business <https://github.com/apps/read-the-docs-business/installations/new/>`__
328
+
329
+
There are three ways to revoke access to the Read the Docs GitHub App:
330
+
331
+
Revoke access to one or more repositories:
332
+
Remove the repositories from the list of repositories that the GitHub App has access to.
333
+
Suspend the GitHub App:
334
+
This will suspend the GitHub App and revoke access to all repositories.
335
+
The installation and configuration will still be available,
336
+
and you can re-enable the GitHub App at any time.
337
+
Uninstall the GitHub App:
338
+
This will uninstall the GitHub App and revoke access to all repositories.
339
+
The installation and configuration will be removed,
340
+
and you will need to re-install the GitHub App and reconfigure it to use it again.
341
+
342
+
Security
343
+
~~~~~~~~
344
+
345
+
When cloning private repositories (|com_brand| only)
346
+
Read the Docs creates an `installation access token <https://docs.github.com/en/rest/apps/apps?apiVersion=2022-11-28#create-an-installation-access-token-for-an-app>`__,
347
+
which has read access to the `contents permission <https://docs.github.com/en/rest/authentication/permissions-required-for-github-apps?apiVersion=2022-11-28#repository-permissions-for-contents>`__,
348
+
and it's scoped to the repository to be cloned.
349
+
350
+
This token is valid for one hour and GitHub automatically grants read access to the `metadata permission <https://docs.github.com/en/rest/authentication/permissions-required-for-github-apps?apiVersion=2022-11-28#repository-permissions-for-metadata>`__,
351
+
which allows to query the repository collaborators, events, and other metadata.
352
+
By default, Read the Docs doesn't show this token during the build,
353
+
but the token is available during the whole build process.
354
+
Make sure to not print it in your build logs,
355
+
and that only trusted users are able to trigger builds on your project.
356
+
357
+
.. note::
358
+
359
+
If your repository is public, Read the Docs will not create an installation access token.
360
+
361
+
.. note::
362
+
363
+
The build log page is publicly accessible only if your project and version to build are marked as public.
364
+
See more in :doc:`/commercial/privacy-level`.
365
+
366
+
Troubleshooting
367
+
~~~~~~~~~~~~~~~
368
+
369
+
Repository not found in the repository list
370
+
Make sure you have installed the corresponding GitHub App in your GitHub account or organization,
371
+
and have granted access to the repository your project will be connected to.
372
+
373
+
- `Read the Docs Community <https://github.com/apps/read-the-docs-community/installations/new/>`__
374
+
- `Read the Docs Business <https://github.com/apps/read-the-docs-business/installations/new/>`__
375
+
376
+
If you still can't see the repository in the list,
377
+
you may need to wait a couple of minutes and refresh the page,
378
+
or click on the "Refresh your repositories" button on the project creation page.
379
+
380
+
Repository is in the list, but isn't usable
381
+
Make sure you have admin access to the repository you are trying to use for your project.
382
+
If you are using |org_brand|, make sure your project is public,
383
+
or use |com_brand| to create projects from private repositories.
384
+
385
+
If you still can't use the repository for your project,
386
+
you may need to wait a couple of minutes and refresh the page,
387
+
or click on the "Refresh your repositories" button on the project creation page.
0 commit comments