-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Add GitHub App service #12072
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add GitHub App service #12072
Changes from 7 commits
2f045d6
7769ed4
6045d3c
1f7d5e1
3883df0
1e3aff6
2ee1b18
db4fbce
586d133
8b95371
b8a8fd6
acd6f63
0518dab
a562f75
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -262,10 +262,30 @@ For others, the webhook will simply fail to connect when there are new commits t | |
|
||
* Configure the applications on GitHub, Bitbucket, and GitLab. | ||
For each of these, the callback URI is ``http://devthedocs.org/accounts/<provider>/login/callback/`` | ||
where ``<provider>`` is one of ``github``, ``gitlab``, or ``bitbucket_oauth2``. | ||
where ``<provider>`` is one of ``github``, ``githubapp``, ``gitlab``, or ``bitbucket_oauth2``. | ||
When setup, you will be given a "Client ID" (also called an "Application ID" or just "Key") and a "Secret". | ||
* Take the "Client ID" and "Secret" for each service and set them as :ref:`environment variables <settings:Allauth secrets>`. | ||
|
||
Configuring GitHub App | ||
~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
- Create a new GitHub app from https://github.com/settings/apps/new. | ||
- Callback URL should be ``http://dev.readthedocs.org/accounts/githubapp/login/callback/``. | ||
stsewd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- Keep marked "Expire user authorization tokens" | ||
- Activate the webhook, and set the URL to one provided by a service like `Webhook.site <https://docs.webhook.site/cli.html>`__ to forward all incoming webhooks to your local development instance. | ||
You should forward all events to ``http://dev.readthedocs.org/webhook/githubapp/``. | ||
- In permissions, select the following: | ||
- Repository permissions: Commit statuses (read and write, so we can create commit statuses), | ||
Contents (read only, so we can clone repos with a token), | ||
Metadata (read only, so we read the repo collaborators), | ||
Pull requests (read and write, so we can post a comment on PRs in the future). | ||
- Organization permissions: Members (read only so we can read the organization members). | ||
- Account permissions: Email addresses (read only, so allauth can fetch all verified emails). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be preferred if these permissions are on an opt-in basis. Many projects may want to start small, and i've seen plenty of them that are skeptical about every little permission. So instead it could be like The minimum permissions necessary for this app are
- Repository permissions:
Contents (read only, so we can clone the repo contents)
Additionally you may grand additional permissions depending on the features you wish to have
- Repository permissions:
Commit statuses (read and write, so we can create commit statuses) It does require the app to read the granted permissions. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi, don't think GH allows for this, the permissions are defined by the app, installations can't choose a subset of permissions. What can happen is that the app requires more permissions and the user can accept or reject those new permissions, but all new installations will always require granting all permissions designated by the app. And even if GH allows for this, not sure that we will support that case, as it requires considering more cases to support, and also support time, as some users don't know why a feature isn't working. |
||
- Subscribe to the following events: Installation target, Member, Organization, Membership, Pull request, Push, and Repository. | ||
- Copy the "Client ID" and "Client Secret" and set them as :ref:`environment variables <settings:Allauth secrets>`. | ||
- Generate a webhook secret and a private key from the GitHub App settings, | ||
and set them as :ref:`environment variables <settings:GitHub App secrets>`. | ||
|
||
Troubleshooting | ||
--------------- | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.