Merge branch 'main' into commonmark-fixes
This commit is contained in:
@@ -0,0 +1,77 @@
|
||||
---
|
||||
title: About creating GitHub Apps
|
||||
shortTitle: About creating apps
|
||||
intro: '{% data variables.product.prodname_github_app %}s let you build integrations to automate processes and extend {% data variables.product.company_short %}''s functionality.'
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
ghae: '*'
|
||||
ghec: '*'
|
||||
redirect_from:
|
||||
- /apps/creating-github-apps/creating-github-apps/about-apps
|
||||
- /apps/building-integrations/setting-up-a-new-integration
|
||||
- /apps/building-integrations
|
||||
- /apps/getting-started-with-building-apps
|
||||
- /apps/about-apps
|
||||
- /developers/apps/about-apps
|
||||
- /developers/apps/getting-started-with-apps/about-apps
|
||||
- /apps/creating-github-apps/setting-up-a-github-app/about-creating-github-apps
|
||||
topics:
|
||||
- GitHub Apps
|
||||
---
|
||||
|
||||
## About {% data variables.product.prodname_github_apps %}
|
||||
|
||||
A {% data variables.product.prodname_github_app %} is a type of integration that you can build to interact with and extend the functionality of {% data variables.product.company_short %}. You can build a {% data variables.product.prodname_github_app %} to provide flexibility and reduce friction in your processes, without needing to sign in a user or create a service account.
|
||||
|
||||
Common use cases for {% data variables.product.prodname_github_apps %} include:
|
||||
- Automating tasks or background processes
|
||||
- Supporting "Sign in with GitHub," which allows users to sign in with their {% data variables.product.prodname_dotcom %} account to provide their identity in your ecosystem
|
||||
- As a developer tool, allowing users to work with {% data variables.product.prodname_dotcom %} by signing into your {% data variables.product.prodname_github_app %}, which can then act on their behalf
|
||||
- Integrating your tool or external service with {% data variables.product.company_short %}
|
||||
|
||||
Like OAuth Apps, {% data variables.product.prodname_github_app %}s use OAuth 2.0 and can act on behalf of a user. Unlike OAuth Apps, {% data variables.product.prodname_github_app %}s can also act independently of a user.
|
||||
|
||||
{% data variables.product.prodname_github_apps %} can be installed directly on organizations and personal accounts and granted access to specific repositories. They come with built-in webhooks and narrow, specific permissions.
|
||||
|
||||
{% data reusables.apps.app_manager_role %}
|
||||
|
||||
## Building a {% data variables.product.prodname_github_app %}
|
||||
|
||||
In order to build a {% data variables.product.prodname_github_app %}, you first need to register a {% data variables.product.prodname_github_app %}. For more information, see "[AUTOTITLE](/apps/creating-github-apps/registering-a-github-app/registering-a-github-app)."
|
||||
|
||||
Then, you need to write code to add functionality to your {% data variables.product.prodname_github_app %}. You can use the credentials from your {% data variables.product.prodname_github_app %} registration to make authenticated requests to {% data variables.product.company_short %}'s APIs. For more information about writing code for your {% data variables.product.prodname_github_app %}, see "[AUTOTITLE](/apps/creating-github-apps/writing-code-for-a-github-app/about-writing-code-for-a-github-app)." For more information about making authenticated requests, see "[AUTOTITLE](/apps/creating-github-apps/authenticating-with-a-github-app/about-authentication-with-a-github-app)."
|
||||
|
||||
Once you have written the code for your {% data variables.product.prodname_github_app %}, your app needs to run somewhere. If your app is a website or web app, you might host your app on a server like [Azure App Service](https://azure.microsoft.com/products/app-service/). If your app is a client-side app, it might run on a user's device.
|
||||
|
||||
In order to use your {% data variables.product.prodname_github_app %}, you must install the app on your organization or personal account. If your {% data variables.product.prodname_github_app %} is private, your can only install the {% data variables.product.prodname_github_app %} on the account that owns the app. If your {% data variables.product.prodname_github_app %} is public, other users and organizations can install your app. For more information, see "[AUTOTITLE](/apps/using-github-apps/installing-your-own-github-app)" and "[AUTOTITLE](/apps/sharing-github-apps/sharing-your-github-app)."
|
||||
|
||||
## Understanding what type of {% data variables.product.prodname_github_app %} to build
|
||||
|
||||
There are multiple ways to design a {% data variables.product.prodname_github_app %} that you will want to consider, based on the functionality you want the app to have.
|
||||
|
||||
### {% data variables.product.prodname_github_apps %} that act on behalf of a user
|
||||
|
||||
If you want your app to take actions on behalf of a user, you should use a user access token for authentication. This type of request is sometimes called "user-to-server," and it means that the app will be limited by the permissions that have been given to the app as well as the user's permission. With this pattern, the user must authorize the app before the app can take action. For more information, see "[AUTOTITLE](/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-with-a-github-app-on-behalf-of-a-user)."
|
||||
|
||||
Some examples of automations you could create with a {% data variables.product.prodname_github_app %}, where the app acts on a user's behalf, include:
|
||||
- A {% data variables.product.prodname_github_app %} that uses {% data variables.product.prodname_dotcom %} as an identity provider for your ecosystem.
|
||||
- A {% data variables.product.prodname_github_app %} that adds a service on top of {% data variables.product.prodname_dotcom_the_website %} that might be useful to a {% data variables.product.prodname_dotcom %} user. You can share the app with other developers via {% data variables.product.prodname_marketplace %} or by making the app public.
|
||||
|
||||
### {% data variables.product.prodname_github_apps %} that act on their own behalf
|
||||
|
||||
If you want your app to take actions on behalf of itself, rather than a user, you should use an installation access token for authentication. This type of request is sometimes called "server-to-server," and it means that the app will be limited by the permissions that have been given to the app. For more information, see "[AUTOTITLE](/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-as-a-github-app-installation)."
|
||||
|
||||
Some examples of automations you could create with a {% data variables.product.prodname_github_app %}, where the app acts on its own behalf, include:
|
||||
- A {% data variables.product.prodname_github_app %} that uses webhooks to react to an event given a certain set of criteria. {% ifversion pat-v2 %}For example, you could create an automation around the REST API endpoints for [reviewing requests for {% data variables.product.pat_v2 %}](/rest/orgs/personal-access-tokens?apiVersion=2022-11-28#review-requests-to-access-organization-resources-with-fine-grained-personal-access-tokens) that approves a request given a certain policy.{% else %}For example, you could create an automation that uses [the REST API endpoints for labels](/rest/issues/labels) to add a label to each new issue created in a repository, given a certain set of criteria.{% endif %}
|
||||
- A {% data variables.product.prodname_github_app %} that helps repository contributors. For example, the app could post helpful resources after a contributor creates a pull request or makes a comment.
|
||||
- A {% data variables.product.prodname_github_app %} that generates short-lived tokens to give to other CI/CD tools, or to pull information from a repository.
|
||||
|
||||
### {% data variables.product.prodname_github_app %}s that respond to webhooks
|
||||
|
||||
If you want your app to respond to events on {% data variables.product.prodname_dotcom %}, your app should subscribe to webhooks. For example, you may want your app to leave a comment when a pull request is opened. For more information, see "[AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/using-webhooks-with-github-apps)."
|
||||
|
||||
### {% data variables.product.prodname_github_app %}s that can take certain actions
|
||||
|
||||
When you set up your {% data variables.product.prodname_github_app %}, you can select specific permissions for the app. These permissions determine what the app can do via the {% data variables.product.prodname_dotcom %} API, what they can do on behalf of a signed in user, and what webhooks the app can receive. For more information, see "[AUTOTITLE](/apps/creating-github-apps/registering-a-github-app/choosing-permissions-for-a-github-app)."
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: Best practices for creating a GitHub App
|
||||
shortTitle: Best practices
|
||||
intro: "Follow these best practices to improve the security and performance of your {% data variables.product.prodname_github_app %}."
|
||||
intro: 'Follow these best practices to improve the security and performance of your {% data variables.product.prodname_github_app %}.'
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
@@ -9,13 +9,15 @@ versions:
|
||||
ghec: '*'
|
||||
topics:
|
||||
- GitHub Apps
|
||||
redirect_from:
|
||||
- /apps/creating-github-apps/setting-up-a-github-app/best-practices-for-creating-a-github-app
|
||||
---
|
||||
|
||||
## Select the minimum permissions required
|
||||
|
||||
Select the minimum permissions that your {% data variables.product.prodname_github_app %} needs. If any keys or tokens for your app become compromised, this will limit the amount of damage that can occur. For more information about how to choose permissions, see "[AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/choosing-permissions-for-a-github-app)."
|
||||
When you register a {% data variables.product.prodname_github_app %}, select the minimum permissions that your {% data variables.product.prodname_github_app %} needs. If any keys or tokens for your app become compromised, this will limit the amount of damage that can occur. For more information about how to choose permissions, see "[AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/choosing-permissions-for-a-github-app)."
|
||||
|
||||
When your app creates an installation access token or user access token, you can further limit the repositories that the app can access and the permissions that the token has. For more information, see "[AUTOTITLE](/apps/creating-github-apps/authenticating-with-a-github-app/generating-an-installation-access-token-for-a-github-app)" and "[AUTOTITLE](/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app)."
|
||||
When your {% data variables.product.prodname_github_app %} creates an installation access token or user access token, you can further limit the repositories that the app can access and the permissions that the token has. For more information, see "[AUTOTITLE](/apps/creating-github-apps/authenticating-with-a-github-app/generating-an-installation-access-token-for-a-github-app)" and "[AUTOTITLE](/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app)."
|
||||
|
||||
## Stay under the rate limit
|
||||
|
||||
@@ -29,7 +31,7 @@ If you do hit a rate limit and need to retry an API request, use the `x-ratelimi
|
||||
|
||||
## Secure your app's credentials
|
||||
|
||||
You can generate a private key and client secret for your app. With these credentials, your app can generate installation access tokens, user access tokens, and refresh tokens. These tokens can be used to make API requests on behalf of an app installation or user.
|
||||
You can generate a private key and client secret for your {% data variables.product.prodname_github_app %}. With these credentials, your app can generate installation access tokens, user access tokens, and refresh tokens. These tokens can be used to make API requests on behalf of an app installation or user.
|
||||
|
||||
You must store these credentials securely. The storage mechanism depends on your integrations architecture and the platform that it runs on. In general, you should use a storage mechanism that is intended to store sensitive data on the platform that you are using.
|
||||
|
||||
@@ -1,55 +1,17 @@
|
||||
---
|
||||
title: About creating GitHub Apps
|
||||
shortTitle: About creating apps
|
||||
intro: "{% data variables.product.prodname_github_app %}s let you build integrations to automate processes and extend {% data variables.product.company_short %}'s functionality."
|
||||
title: Deciding when to build a GitHub App
|
||||
shortTitle: GitHub App versus other options
|
||||
intro: 'When building an integration, you should consider using a {% data variables.product.prodname_github_app %} in the following scenarios, instead of an {% data variables.product.prodname_oauth_app %}, {% data variables.product.pat_generic%}, or {% data variables.product.prodname_actions %}.'
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
ghae: '*'
|
||||
ghec: '*'
|
||||
redirect_from:
|
||||
- /apps/creating-github-apps/creating-github-apps/about-apps
|
||||
- /apps/building-integrations/setting-up-a-new-integration
|
||||
- /apps/building-integrations
|
||||
- /apps/getting-started-with-building-apps
|
||||
- /apps/about-apps
|
||||
- /developers/apps/about-apps
|
||||
- /developers/apps/getting-started-with-apps/about-apps
|
||||
topics:
|
||||
- GitHub Apps
|
||||
---
|
||||
|
||||
## About {% data variables.product.prodname_github_apps %}
|
||||
|
||||
A {% data variables.product.prodname_github_app %} is a type of integration that you can build to interact with and extend the functionality of {% data variables.product.company_short %}. You can build a {% data variables.product.prodname_github_app %} to provide flexibility and reduce friction in your processes, without needing to sign in a user or create a service account.
|
||||
|
||||
Common use cases for {% data variables.product.prodname_github_apps %} include:
|
||||
- Automating tasks or background processes
|
||||
- Supporting "Sign in with GitHub," which allows users to sign in with their {% data variables.product.prodname_dotcom %} account to provide their identity in your ecosystem
|
||||
- As a developer tool, allowing users to work with {% data variables.product.prodname_dotcom %} by signing into your {% data variables.product.prodname_github_app %}, which can then act on their behalf
|
||||
- Integrating your tool or external service with {% data variables.product.company_short %}
|
||||
|
||||
{% data variables.product.prodname_github_apps %} are independent actors within {% data variables.product.prodname_dotcom %}. A {% data variables.product.prodname_github_app %} acts on its own behalf, which means that you don't need to maintain a bot or service account as a separate user. They can also authenticate as a user and act on the user's behalf, using the permissions granted to it.
|
||||
|
||||
{% data reusables.apps.maximum-github-apps-allowed %}
|
||||
|
||||
If you want your app to respond to events on {% data variables.product.prodname_dotcom %}, your app should subscribe to webhooks. For example, you may want your app to leave a comment when a pull request is opened. For more information, see "[AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/using-webhooks-with-github-apps)."
|
||||
|
||||
During development, you can run your app locally for development. Once the app is ready for production use, you should deploy your app to a dedicated server. For example, you can use [Azure App Service](https://azure.microsoft.com/products/app-service/).
|
||||
|
||||
### Permissions and visibility for {% data variables.product.prodname_github_apps %}
|
||||
|
||||
{% data variables.product.prodname_github_apps %} can be installed directly on organizations and personal accounts and granted access to specific repositories. They come with built-in webhooks and narrow, specific permissions. When you set up your {% data variables.product.prodname_github_app %}, you can select specific permissions for the app. These permissions determine what the app can do via the {% data variables.product.prodname_dotcom %} API, what they can do on behalf of a signed in user, and what webhooks the app can receive. When the app is then installed on a user or organization account, the person who installs the app decides what repositories the app can access under that account. For more information, see "[AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/choosing-permissions-for-a-github-app)."
|
||||
|
||||
{% data reusables.apps.app_manager_role %}
|
||||
|
||||
You can set the visibility of your app to control who can install it. You can make it public so that other {% data variables.product.prodname_dotcom %} users or organizations can install the app, or private so that you can only install it on the account that owns the app. For more information, see "[AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/making-a-github-app-public-or-private)."
|
||||
|
||||
## When to use {% data variables.product.prodname_github_apps %}
|
||||
|
||||
When building an integration, you should consider using a {% data variables.product.prodname_github_app %} in the following scenarios instead of an {% data variables.product.prodname_oauth_app %}, {% data variables.product.pat_generic%}, or {% data variables.product.prodname_actions %}.
|
||||
|
||||
### Using a {% data variables.product.prodname_github_app %} instead of an {% data variables.product.prodname_oauth_app %}
|
||||
## Using a {% data variables.product.prodname_github_app %} instead of an {% data variables.product.prodname_oauth_app %}
|
||||
|
||||
In general, {% data variables.product.prodname_github_app %}s are preferred over {% data variables.product.prodname_oauth_app %}s.
|
||||
|
||||
@@ -61,7 +23,7 @@ For more information, see "[AUTOTITLE](/apps/oauth-apps/building-oauth-apps/diff
|
||||
|
||||
For information on how to migrate an existing {% data variables.product.prodname_oauth_app %} to a {% data variables.product.prodname_github_app %}, see "[AUTOTITLE](/apps/creating-github-apps/guides/migrating-oauth-apps-to-github-apps)."
|
||||
|
||||
#### {% data variables.product.prodname_github_app %}s offer enhanced security
|
||||
### {% data variables.product.prodname_github_app %}s offer enhanced security
|
||||
|
||||
{% data variables.product.prodname_github_app %}s provide more control over what the app can do. Instead of the broad scopes that {% data variables.product.prodname_oauth_app %}s use, {% data variables.product.prodname_github_app %}s use fine-grained permissions. For example, if your app needs to read the contents of a repository, an {% data variables.product.prodname_oauth_app %} would require the `repo` scope, which would also let the app edit the repository contents and settings. A {% data variables.product.prodname_github_app %} can request read-only access to repository contents, which will not let the app take more privileged actions like editing the repository contents or settings.
|
||||
|
||||
@@ -71,7 +33,7 @@ For information on how to migrate an existing {% data variables.product.prodname
|
||||
|
||||
These security features help harden your {% data variables.product.prodname_github_app %}'s security by limiting the damage that could be done if your app's credentials were leaked. Additionally, this lets organizations with stricter security policies use your app.
|
||||
|
||||
#### {% data variables.product.prodname_github_app %}s can act independently of or on behalf of a user
|
||||
### {% data variables.product.prodname_github_app %}s can act independently of or on behalf of a user
|
||||
|
||||
{% data variables.product.prodname_github_app %}s can act independently of a user. This is beneficial for automations that do not require user input.
|
||||
|
||||
@@ -79,15 +41,15 @@ Similar to {% data variables.product.prodname_oauth_app %}s, {% data variables.p
|
||||
|
||||
{% data variables.product.prodname_github_app %}s are not tied to a user account and do not consume a seat on {% data variables.product.product_name %}. {% data variables.product.prodname_github_app %}s remain installed even when the person who initially installed the app leaves the organization. This lets your integrations continue to work even if people leave your team.
|
||||
|
||||
#### {% data variables.product.prodname_github_app %}s have scalable rate limits
|
||||
### {% data variables.product.prodname_github_app %}s have scalable rate limits
|
||||
|
||||
The rate limit for {% data variables.product.prodname_github_app %}s using an installation access token scales with the number of repositories and number of organization users. Conversely, {% data variables.product.prodname_oauth_apps %} have lower rate limits and do not scale. For more information, see "[AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/rate-limits-for-github-apps)."
|
||||
|
||||
#### {% data variables.product.prodname_github_app %}s have built in webhooks
|
||||
### {% data variables.product.prodname_github_app %}s have built in webhooks
|
||||
|
||||
{% data variables.product.prodname_github_app %}s have built-in, centralized webhooks. {% data variables.product.prodname_github_app %}s can receive webhook events for all repositories and organizations the app can access. Conversely, {% data variables.product.prodname_oauth_app %}s must configure webhooks individually for each repository and organization.
|
||||
|
||||
#### API access differs slightly
|
||||
### API access differs slightly
|
||||
|
||||
In general, {% data variables.product.prodname_github_app %}s and {% data variables.product.prodname_oauth_app %}s can make the same API requests. However, there are some differences:
|
||||
|
||||
@@ -97,7 +59,7 @@ In general, {% data variables.product.prodname_github_app %}s and {% data variab
|
||||
|
||||
For more information about the REST API endpoints that are available to {% data variables.product.prodname_github_app %}s, see "[AUTOTITLE](/rest/overview/endpoints-available-for-github-apps)."
|
||||
|
||||
### Choosing between a {% data variables.product.prodname_github_app %} or a {% data variables.product.pat_generic %}
|
||||
## Choosing between a {% data variables.product.prodname_github_app %} or a {% data variables.product.pat_generic %}
|
||||
|
||||
If you want to access {% data variables.product.prodname_dotcom %} resources on behalf of a user or in an organization, or you anticipate a long-lived integration, we recommend building a {% data variables.product.prodname_github_app %}.
|
||||
|
||||
@@ -105,7 +67,7 @@ For more information about the REST API endpoints that are available to {% data
|
||||
|
||||
{% data variables.product.company_short %} supports two types of {% data variables.product.pat_generic_plural %}, but recommends that you use {% data variables.product.pat_v2 %}s instead of {% data variables.product.pat_v1_plural %} whenever possible. For more information about {% data variables.product.pat_generic_plural %}, see "[AUTOTITLE](/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#types-of-personal-access-tokens)."
|
||||
|
||||
### Choosing between a {% data variables.product.prodname_github_app %} or {% data variables.product.prodname_actions %}
|
||||
## Choosing between a {% data variables.product.prodname_github_app %} or {% data variables.product.prodname_actions %}
|
||||
|
||||
{% data variables.product.prodname_github_apps %} and {% data variables.product.prodname_actions %} both provide ways to build automation and workflow tools.
|
||||
|
||||
@@ -118,29 +80,3 @@ For more information about comparing {% data variables.product.prodname_actions
|
||||
You can use a {% data variables.product.prodname_github_app %} to authenticate in a {% data variables.product.prodname_actions %}
|
||||
workflow if the built in `GITHUB_TOKEN` does not have sufficient permissions. For more information, see "[AUTOTITLE](/apps/creating-github-apps/guides/making-authenticated-api-requests-with-a-github-app-in-a-github-actions-workflow)."
|
||||
|
||||
## Understanding what type of {% data variables.product.prodname_github_app %} to build
|
||||
|
||||
There are multiple ways to design a {% data variables.product.prodname_github_app %} that you will want to consider, based on the functionality you want the app to have.
|
||||
|
||||
### {% data variables.product.prodname_github_apps %} that act on behalf of a user
|
||||
|
||||
If you want your app to take actions on behalf of a user, you should use a user access token for authentication. This type of request is sometimes called "user-to-server," and it means that the app will be limited by the permissions that have been given to the app as well as the user's permission. With this pattern, the user must authorize the app before the app can take action. For more information, see "[AUTOTITLE](/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-with-a-github-app-on-behalf-of-a-user)."
|
||||
|
||||
Some examples of automations you could create with a {% data variables.product.prodname_github_app %}, where the app acts on a user's behalf, include:
|
||||
- A {% data variables.product.prodname_github_app %} that uses {% data variables.product.prodname_dotcom %} as an identity provider for your ecosystem
|
||||
- A {% data variables.product.prodname_github_app %} that adds a service on top of {% data variables.product.prodname_dotcom_the_website %} that might be useful to a {% data variables.product.prodname_dotcom %} user. You can share the app with other developers via {% data variables.product.prodname_marketplace %} or by making the app public
|
||||
|
||||
### {% data variables.product.prodname_github_apps %} that act on their own behalf
|
||||
|
||||
If you want your app to take actions on behalf of itself, rather than a user, you should use an installation access token for authentication. This type of request is sometimes called "server-to-server," and it means that the app will be limited by the permissions that have been given to the app. For more information, see "[AUTOTITLE](/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-as-a-github-app-installation)."
|
||||
|
||||
Some examples of automations you could create with a {% data variables.product.prodname_github_app %}, where the app acts on its own behalf, include:
|
||||
- A {% data variables.product.prodname_github_app %} that uses webhooks to react to an event given a certain set of criteria. {% ifversion pat-v2 %}For example, you could create an automation around the REST API endpoints for [reviewing requests for {% data variables.product.pat_v2 %}](/rest/orgs/personal-access-tokens?apiVersion=2022-11-28#review-requests-to-access-organization-resources-with-fine-grained-personal-access-tokens) that approves a request given a certain policy{% else %}For example, you could create an automation that uses [the REST API endpoints for labels](/rest/issues/labels) to add a label to each new issue created in a repository, given a certain set of criteria{% endif %}
|
||||
- A {% data variables.product.prodname_github_app %} that helps repository contributors. For example, the app could post helpful resources after a contributor creates a pull request or makes a comment
|
||||
- A {% data variables.product.prodname_github_app %} that generates short-lived tokens to give to other CI/CD tools, or to pull information from a repository
|
||||
|
||||
## Further reading
|
||||
|
||||
- "[AUTOTITLE](/apps/creating-github-apps/creating-github-apps/creating-a-github-app)"
|
||||
- "[AUTOTITLE](/apps/creating-github-apps/authenticating-with-a-github-app/about-authentication-with-a-github-app)"
|
||||
- [Guides on building GitHub Apps](/apps/creating-github-apps/guides)
|
||||
@@ -0,0 +1,18 @@
|
||||
---
|
||||
title: About creating GitHub Apps
|
||||
shortTitle: About creating GitHub Apps
|
||||
intro: todo
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
ghae: '*'
|
||||
ghec: '*'
|
||||
topics:
|
||||
- GitHub Apps
|
||||
children:
|
||||
- /about-creating-github-apps
|
||||
- /deciding-when-to-build-a-github-app
|
||||
- /best-practices-for-creating-a-github-app
|
||||
- /migrating-oauth-apps-to-github-apps
|
||||
---
|
||||
|
||||
@@ -6,6 +6,7 @@ redirect_from:
|
||||
- /developers/apps/migrating-oauth-apps-to-github-apps
|
||||
- /developers/apps/getting-started-with-apps/migrating-oauth-apps-to-github-apps
|
||||
- /apps/creating-github-apps/guides/migrating-oauth-apps-to-github-apps
|
||||
- /apps/creating-github-apps/setting-up-a-github-app/migrating-oauth-apps-to-github-apps
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
@@ -57,7 +58,7 @@ Once you have registered a {% data variables.product.prodname_github_app %}, ada
|
||||
|
||||
You will need to update your app's code to handle API authentication for your {% data variables.product.prodname_github_app %}. A {% data variables.product.prodname_github_app %} can authenticate in three ways:
|
||||
|
||||
- As the app itself, in order to get or modify details about the app or to create an installation access token. For more information, see "[AUTOTITLE](/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-as-a-github-app)."
|
||||
- As the app itself, in order to get or modify details about the {% data variables.product.prodname_github_app %} registration or to create an installation access token. For more information, see "[AUTOTITLE](/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-as-a-github-app)."
|
||||
- As an app installation, in order to take actions on behalf of itself. For more information, see "[AUTOTITLE](/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-as-a-github-app-installation)."
|
||||
- On behalf of a user, in order to attribute actions to a user. For more information, see "[AUTOTITLE](/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-with-a-github-app-on-behalf-of-a-user)."
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: 'Authenticating with a {% data variables.product.prodname_github_app %}'
|
||||
shortTitle: Authentication
|
||||
shortTitle: 'Authenticate with a {% data variables.product.prodname_github_app %}'
|
||||
intro: 'Learn how to authenticate with {% data variables.product.prodname_github_apps %}.'
|
||||
versions:
|
||||
fpt: '*'
|
||||
@@ -19,5 +19,6 @@ children:
|
||||
- /generating-an-installation-access-token-for-a-github-app
|
||||
- /generating-a-user-access-token-for-a-github-app
|
||||
- /refreshing-user-access-tokens
|
||||
- /making-authenticated-api-requests-with-a-github-app-in-a-github-actions-workflow
|
||||
---
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: Making authenticated API requests with a GitHub App in a GitHub Actions workflow
|
||||
shortTitle: Use with Actions
|
||||
intro: "You can use an installation access token from a {% data variables.product.prodname_github_app %} to make authenticated API requests in a {% data variables.product.prodname_actions %} workflow. You can also pass the token to a custom action to enable the action to make authenticated API requests."
|
||||
shortTitle: Authenticate in Actions workflow
|
||||
intro: 'You can use an installation access token from a {% data variables.product.prodname_github_app %} to make authenticated API requests in a {% data variables.product.prodname_actions %} workflow. You can also pass the token to a custom action to enable the action to make authenticated API requests.'
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
@@ -10,6 +10,9 @@ versions:
|
||||
topics:
|
||||
- GitHub Apps
|
||||
- Actions
|
||||
redirect_from:
|
||||
- /apps/creating-github-apps/guides/making-authenticated-api-requests-with-a-github-app-in-a-github-actions-workflow
|
||||
- /apps/creating-github-apps/writing-code-for-a-github-app/making-authenticated-api-requests-with-a-github-app-in-a-github-actions-workflow
|
||||
---
|
||||
|
||||
## About {% data variables.product.prodname_actions %} authentication
|
||||
@@ -18,9 +21,9 @@ If you need to make authenticated API requests in a {% data variables.product.pr
|
||||
|
||||
## Authenticating with a {% data variables.product.prodname_github_app %}
|
||||
|
||||
In order to use a {% data variables.product.prodname_github_app %} to make authenticated API requests, you must create a {% data variables.product.prodname_github_app %}, store your app's credentials, and install your app. Once this is done, you can use your app to create an installation access token, which can be used to make authenticated API requests in a {% data variables.product.prodname_actions %} workflow. You can also pass the installation access token to a custom action that requires a token.
|
||||
In order to use a {% data variables.product.prodname_github_app %} to make authenticated API requests, you must register a {% data variables.product.prodname_github_app %}, store your app's credentials, and install your app. Once this is done, you can use your app to create an installation access token, which can be used to make authenticated API requests in a {% data variables.product.prodname_actions %} workflow. You can also pass the installation access token to a custom action that requires a token.
|
||||
|
||||
1. Create a {% data variables.product.prodname_github_app %}. Give your {% data variables.product.prodname_github_app %} the necessary permissions to access the desired resources. For more information, see "[AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app)" and "[AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/choosing-permissions-for-a-github-app)."
|
||||
1. Register a {% data variables.product.prodname_github_app %}. Give your {% data variables.product.prodname_github_app %} registration the necessary permissions to access the desired resources. For more information, see "[AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app)" and "[AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/choosing-permissions-for-a-github-app)."
|
||||
1. Store the app ID of your {% data variables.product.prodname_github_app %} as a {% data variables.product.prodname_actions %} secret. You can find the app ID on the settings page for your app. The app ID is different from the client ID. For more information about storing secrets, see "[AUTOTITLE](/actions/security-guides/encrypted-secrets)."
|
||||
1. Generate a private key for your app. Store the contents of the resulting file as a secret. (Store the entire contents of the file, including `-----BEGIN RSA PRIVATE KEY-----` and `-----END RSA PRIVATE KEY-----`.) For more information, see "[AUTOTITLE](/apps/creating-github-apps/authenticating-with-a-github-app/managing-private-keys-for-github-apps)."
|
||||
1. Install the {% data variables.product.prodname_github_app %} on your user account or organization and grant it access to any repositories that you want your workflow to access. For more information, see "[AUTOTITLE](/apps/maintaining-github-apps/installing-github-apps#installing-your-private-github-app-on-your-repository)."
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: 'Creating GitHub Apps'
|
||||
title: Creating GitHub Apps
|
||||
intro: You can build GitHub Apps for yourself or others to use.
|
||||
versions:
|
||||
fpt: '*'
|
||||
@@ -9,10 +9,12 @@ versions:
|
||||
topics:
|
||||
- GitHub Apps
|
||||
children:
|
||||
- /setting-up-a-github-app
|
||||
- /about-creating-github-apps
|
||||
- /registering-a-github-app
|
||||
- /authenticating-with-a-github-app
|
||||
- /guides
|
||||
- /writing-code-for-a-github-app
|
||||
redirect_from:
|
||||
- /apps/building-integrations/setting-up-and-registering-github-apps
|
||||
- /developers/apps/building-github-apps
|
||||
---
|
||||
|
||||
|
||||
@@ -9,9 +9,11 @@ versions:
|
||||
topics:
|
||||
- GitHub Apps
|
||||
shortTitle: Setup URL
|
||||
redirect_from:
|
||||
- /apps/creating-github-apps/setting-up-a-github-app/about-the-setup-url
|
||||
---
|
||||
|
||||
When you create a {% data variables.product.prodname_github_app %}, you can specify a setup URL. When users install your {% data variables.product.prodname_github_app %}, they are redirected to the setup URL. If additional setup is required after installation, you can use this URL to tell users what steps to take next.
|
||||
When you register a {% data variables.product.prodname_github_app %}, you can specify a setup URL. When users install your {% data variables.product.prodname_github_app %}, they are redirected to the setup URL. If additional setup is required after installation, you can use this URL to tell users what steps to take next.
|
||||
|
||||
If you specify a setup URL, you can also select **Redirect on update** to specify that users should be redirected to the setup URL after they update an installation. An update includes adding or removing access to a repository for an installation.
|
||||
|
||||
@@ -22,9 +24,9 @@ If you specify a setup URL, you can also select **Redirect on update** to specif
|
||||
{% endwarning %}
|
||||
|
||||
{% ifversion fpt or ghec %}
|
||||
Although the setup URL is optional in the {% data variables.product.prodname_github_app %} settings, it is required if you want to allow users to purchase your app in {% data variables.product.prodname_marketplace %}. For more information, see "[AUTOTITLE](/apps/publishing-apps-to-github-marketplace/using-the-github-marketplace-api-in-your-app/handling-new-purchases-and-free-trials)."
|
||||
Although the setup URL is optional during {% data variables.product.prodname_github_app %} registration, it is required if you want to allow users to purchase your app in {% data variables.product.prodname_marketplace %}. For more information, see "[AUTOTITLE](/apps/publishing-apps-to-github-marketplace/using-the-github-marketplace-api-in-your-app/handling-new-purchases-and-free-trials)."
|
||||
{% endif %}
|
||||
|
||||
The setup URL is different from the callback URL. Users are redirected to the setup URL after they install a {% data variables.product.prodname_github_app %}. Users are redirected to the callback URL when they authorize a {% data variables.product.company_short %} via the web application flow. For more information, see "[AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/about-the-user-authorization-callback-url)."
|
||||
|
||||
For more information about creating or modifying a {% data variables.product.prodname_github_app %}, see "[AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app)" and "[AUTOTITLE](/apps/maintaining-github-apps/modifying-a-github-app)."
|
||||
For more information about registering a {% data variables.product.prodname_github_app %}, see "[AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app)." For more information about modifying a {% data variables.product.prodname_github_app %} registration, see "[AUTOTITLE](/apps/maintaining-github-apps/modifying-a-github-app)."
|
||||
@@ -0,0 +1,24 @@
|
||||
---
|
||||
title: About the user authorization callback URL
|
||||
intro: 'You can specify a URL that users will be redirected to after they authorize a {% data variables.product.prodname_github_app %}.'
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
ghae: '*'
|
||||
ghec: '*'
|
||||
topics:
|
||||
- GitHub Apps
|
||||
shortTitle: Callback URL
|
||||
redirect_from:
|
||||
- /apps/creating-github-apps/creating-github-apps/about-the-user-authorization-callback-url
|
||||
- /apps/creating-github-apps/setting-up-a-github-app/about-the-user-authorization-callback-url
|
||||
---
|
||||
|
||||
When you register a {% data variables.product.prodname_github_app %}, you can specify a callback URL. When you use the web application flow to generate a user access token in order to act on behalf of a user, users will be redirected to the callback URL after they authorize the {% data variables.product.prodname_github_app %}.
|
||||
|
||||
You can specify up to 10 callback URLs. If you specify multiple callback URLs, you can use the `redirect_uri` parameter when you prompt the user to authorize your {% data variables.product.prodname_github_app %}, to indicate which callback URL the user should be redirected to. If you do not specify `redirect_uri`, the first callback URL will be used. For more information about using the `redirect_uri` parameter, see "[AUTOTITLE](/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app)".
|
||||
|
||||
The callback URL is different from the setup URL. Users are redirected to the setup URL after they install a {% data variables.product.prodname_github_app %}. Users are redirected to the callback URL when they authorize a {% data variables.product.prodname_github_app %} via the web application flow. For more information, see "[AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/about-the-setup-url)."
|
||||
|
||||
For more information about generating user access tokens, see "[AUTOTITLE](/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app)". For more information about registering a {% data variables.product.prodname_github_app %}, see "[AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app)." For more information about modifying a {% data variables.product.prodname_github_app %} registration, see "[AUTOTITLE](/apps/maintaining-github-apps/modifying-a-github-app)."
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: Choosing permissions for a GitHub App
|
||||
shortTitle: Permissions
|
||||
intro: "The permissions of a GitHub App determine what the app can do with {% data variables.product.company_short %}'s APIs and what webhooks the app can receive."
|
||||
intro: 'The permissions of a GitHub App determine what the app can do with {% data variables.product.company_short %}''s APIs and what webhooks the app can receive.'
|
||||
redirect_from:
|
||||
- /apps/building-integrations/setting-up-and-registering-github-apps/about-permissions-for-github-apps
|
||||
- /apps/building-github-apps/permissions-for-github-apps
|
||||
@@ -10,6 +10,7 @@ redirect_from:
|
||||
- /developers/apps/building-github-apps/setting-permissions-for-github-apps
|
||||
- /apps/creating-github-apps/creating-github-apps/setting-permissions-for-github-apps
|
||||
- /apps/creating-github-apps/creating-github-apps/choosing-permissions-for-a-github-app
|
||||
- /apps/creating-github-apps/setting-up-a-github-app/choosing-permissions-for-a-github-app
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
@@ -21,7 +22,7 @@ topics:
|
||||
|
||||
## About {% data variables.product.prodname_github_app %} permissions
|
||||
|
||||
{% data variables.product.prodname_github_app %}s don't have any permissions by default. When you create an app, you can select permissions for the app. The permissions that you select determine what the app can do with {% data variables.product.company_short %}'s APIs and what webhooks the app can subscribe to. You should select the minimum permissions required for the app.
|
||||
{% data variables.product.prodname_github_app %}s don't have any permissions by default. When you register a {% data variables.product.prodname_github_app %}, you can select permissions for the app. The permissions that you select determine what the app can do with {% data variables.product.company_short %}'s APIs and what webhooks the app can subscribe to. You should select the minimum permissions required for the app.
|
||||
|
||||
Although {% data variables.product.prodname_github_app %}s don't have any permissions by default, they do have implicit permissions to read public resources when acting on behalf of a user. When a user authorizes the app to act on their behalf, the {% data variables.product.prodname_github_app %} can use the resulting user access token to make requests to the REST API{% ifversion graphQL-for-fgpats-and-apps %} and the GraphQL API{% endif %} to read public resources. To learn more about acting on behalf of a user, see "[AUTOTITLE](/apps/creating-github-apps/authenticating-with-a-github-app/authenticating-with-a-github-app-on-behalf-of-a-user)."
|
||||
|
||||
@@ -35,7 +36,7 @@ You can modify the permissions for your app at any time. When you modify the per
|
||||
|
||||
Some webhooks and API access requires "Administration" permissions. If your app requires "Administration" permissions, consider explaining this requirement on your app's homepage. This will help users understand why your app needs a high level permission.
|
||||
|
||||
For more information about specifying permissions during app creation, see "[AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app)." For more information about modifying permissions, see "[AUTOTITLE](/apps/maintaining-github-apps/editing-a-github-apps-permissions)."
|
||||
For more information about specifying permissions during {% data variables.product.prodname_github_app %} registration, see "[AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app)." For more information about modifying permissions, see "[AUTOTITLE](/apps/maintaining-github-apps/editing-a-github-apps-permissions)."
|
||||
|
||||
## Choosing permissions for webhook access
|
||||
|
||||
@@ -43,7 +44,7 @@ The webhook documentation indicates whether each webhook is available to {% data
|
||||
|
||||
For example, if you want your app to subscribe to `team` events, your app must have the "Members" organization permission.
|
||||
|
||||
On your app settings page, the available webhook events will change as you change your app's permissions. If you did not select sufficient permissions for your app to subscribe to an event, the event will not appear as an option on your app settings page.
|
||||
On your {% data variables.product.prodname_github_app %} registration page, the available webhook events will change as you change your app's permissions. If you did not select sufficient permissions for your {% data variables.product.prodname_github_app %} to subscribe to an event, the event will not appear as an option on your app registration page.
|
||||
|
||||
## Choosing permissions for REST API access
|
||||
|
||||
@@ -6,6 +6,7 @@ redirect_from:
|
||||
- /developers/apps/creating-a-custom-badge-for-your-github-app
|
||||
- /developers/apps/building-github-apps/creating-a-custom-badge-for-your-github-app
|
||||
- /apps/creating-github-apps/creating-github-apps/creating-a-custom-badge-for-your-github-app
|
||||
- /apps/creating-github-apps/setting-up-a-github-app/creating-a-custom-badge-for-your-github-app
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
@@ -20,7 +21,7 @@ An identicon badge looks something like this:
|
||||
|
||||

|
||||
|
||||
After you create a GitHub App, you can customize your app's badge by uploading a logo and selecting a background color. A badge is a square logo image inside of a circular badge. You can choose a background color for the badge, which can visually distinguish your app.
|
||||
After you register a GitHub App, you can customize your app's badge by uploading a logo and selecting a background color. A badge is a square logo image inside of a circular badge. You can choose a background color for the badge, which can visually distinguish your app.
|
||||
|
||||
Your logo should be a PNG, JPG, or GIF file under 1 MB in size. For the best quality rendering, we recommend an image size of at least 200px x 200px. {% ifversion fpt or ghec %}See "[AUTOTITLE](/apps/publishing-apps-to-github-marketplace/listing-an-app-on-github-marketplace/writing-a-listing-description-for-your-app#guidelines-for-logos)" for more guidance on customizing badges.{% endif %}
|
||||
|
||||
@@ -51,6 +52,6 @@ To create a custom badge:
|
||||
|
||||
## Next steps
|
||||
|
||||
For more information about creating a Marketplace listing for this app, see "[AUTOTITLE](/apps/publishing-apps-to-github-marketplace/listing-an-app-on-github-marketplace)".
|
||||
For more information about listing your {% data variables.product.prodname_github_app %} in {% data variables.product.prodname_marketplace %}, see "[AUTOTITLE](/apps/publishing-apps-to-github-marketplace/listing-an-app-on-github-marketplace)".
|
||||
|
||||
{% endif %}
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: 'Setting up a {% data variables.product.prodname_github_app %}'
|
||||
title: 'Registering a {% data variables.product.prodname_github_app %}'
|
||||
intro: 'Learn about building {% data variables.product.prodname_github_apps %}.'
|
||||
versions:
|
||||
fpt: '*'
|
||||
@@ -9,11 +9,11 @@ versions:
|
||||
redirect_from:
|
||||
- /apps/building-github-apps
|
||||
- /apps/creating-github-apps/creating-github-apps
|
||||
- /apps/creating-github-apps/setting-up-a-github-app
|
||||
topics:
|
||||
- GitHub Apps
|
||||
children:
|
||||
- /about-creating-github-apps
|
||||
- /creating-a-github-app
|
||||
- /registering-a-github-app
|
||||
- /about-the-user-authorization-callback-url
|
||||
- /about-the-setup-url
|
||||
- /choosing-permissions-for-a-github-app
|
||||
@@ -21,7 +21,5 @@ children:
|
||||
- /making-a-github-app-public-or-private
|
||||
- /rate-limits-for-github-apps
|
||||
- /creating-a-custom-badge-for-your-github-app
|
||||
- /migrating-oauth-apps-to-github-apps
|
||||
- /best-practices-for-creating-a-github-app
|
||||
---
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: Making a GitHub App public or private
|
||||
intro: 'When setting up a {% data variables.product.prodname_github_app %}, you can make it public so that other GitHub users or organizations can install the app, or private so that you can only install it on the account that owns the app.'
|
||||
intro: 'When registering a {% data variables.product.prodname_github_app %}, you can make it public so that other GitHub users or organizations can install the app, or private so that you can only install it on the account that owns the app.'
|
||||
redirect_from:
|
||||
- /apps/building-integrations/setting-up-and-registering-github-apps/about-installation-options-for-github-apps
|
||||
- /apps/building-github-apps/installation-options-for-github-apps
|
||||
@@ -10,6 +10,7 @@ redirect_from:
|
||||
- /developers/apps/making-a-github-app-public-or-private
|
||||
- /developers/apps/managing-github-apps/making-a-github-app-public-or-private
|
||||
- /apps/creating-github-apps/creating-github-apps/making-a-github-app-public-or-private
|
||||
- /apps/creating-github-apps/setting-up-a-github-app/making-a-github-app-public-or-private
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
@@ -22,19 +23,19 @@ shortTitle: Visibility
|
||||
|
||||
## About visibility for {% data variables.product.prodname_github_app %}s
|
||||
|
||||
You can make your {% data variables.product.prodname_github_app %} public or private. {% ifversion fpt %}If you set your {% data variables.product.prodname_github_app %} to public, any user on {% data variables.product.prodname_dotcom_the_website %} or {% data variables.product.prodname_ghe_cloud %} can install it. If you set your {% data variables.product.prodname_github_app %} to private, it can only be installed on the account that owns the app.
|
||||
You can make your {% data variables.product.prodname_github_app %} registration public or private. {% ifversion fpt %}If you set your {% data variables.product.prodname_github_app %} registration to public, any user on {% data variables.product.prodname_dotcom_the_website %} or {% data variables.product.prodname_ghe_cloud %} can install it. If you set your {% data variables.product.prodname_github_app %} registration to private, it can only be installed on the account that owns the app.
|
||||
|
||||
{% elsif ghes %}If you set your {% data variables.product.prodname_github_app %} to public, anyone on your {% data variables.product.prodname_ghe_server %} instance can install it, but the app is not available outside of your instance. If you set your {% data variables.product.prodname_github_app %} to private, it can only be installed on the account that owns the app.
|
||||
{% elsif ghes %}If you set your {% data variables.product.prodname_github_app %} registration to public, anyone on your {% data variables.product.prodname_ghe_server %} instance can install it, but the app is not available outside of your instance. If you set your {% data variables.product.prodname_github_app %} registration to private, it can only be installed on the account that owns the app.
|
||||
|
||||
{% elsif ghec %}If you set your {% data variables.product.prodname_github_app %} to public, and the {% data variables.product.prodname_github_app %} is owned by an {% data variables.product.prodname_emu %} account, accounts owned by your enterprise can install it, but the app cannot be installed on accounts outside of your enterprise. If a {% data variables.product.prodname_github_app %} is owned by an account that is not an {% data variables.product.prodname_emu %}, and the app is set to public, any user on {% data variables.product.prodname_dotcom_the_website %} or {% data variables.product.prodname_ghe_cloud %} can install the app. If you set your {% data variables.product.prodname_github_app %} to private, it can only be installed on the account that owns the app.{% endif %}
|
||||
{% elsif ghec %}If you set your {% data variables.product.prodname_github_app %} registration to public, and the {% data variables.product.prodname_github_app %} registration is owned by an {% data variables.product.prodname_emu %} account, accounts owned by your enterprise can install it, but the app cannot be installed on accounts outside of your enterprise. If a {% data variables.product.prodname_github_app %} registration is owned by an account that is not an {% data variables.product.prodname_emu %}, and the app is set to public, any user on {% data variables.product.prodname_dotcom_the_website %} or {% data variables.product.prodname_ghe_cloud %} can install the app. If you set your {% data variables.product.prodname_github_app %} registration to private, it can only be installed on the account that owns the app.{% endif %}
|
||||
|
||||
{% ifversion fpt or ghec %}You can create a {% data variables.product.prodname_github_app %} from your individual user account and make it available for organization accounts to install. You do not need an enterprise plan or an organization account to create a {% data variables.product.prodname_github_app %} for organizations even if the organization is owned by an enterprise on {% data variables.product.prodname_ghe_cloud %}.{% endif %}
|
||||
{% ifversion fpt or ghec %}You can register a {% data variables.product.prodname_github_app %} under your personal account or organization and make it available for other organizations to install. You do not need an enterprise plan or an organization account to make your {% data variables.product.prodname_github_app %} available to an organization even if the organization is owned by an enterprise on {% data variables.product.prodname_ghe_cloud %}.{% endif %}
|
||||
|
||||
If you want to make your app available to {% ifversion ghes %}other {% endif %}{% data variables.product.prodname_ghe_server %} instances, then you need to use an app manifest. The {% data variables.product.prodname_ghe_server %} instance will create the app from the manifest and provide you with the required information. For more information, see "[AUTOTITLE](/developers/apps/building-github-apps/creating-a-github-app-from-a-manifest)."
|
||||
If you want to make your app available to {% ifversion ghes %}other {% endif %}{% data variables.product.prodname_ghe_server %} instances, then you need to take additional steps. For more information, see "[AUTOTITLE](/apps/sharing-github-apps/making-your-github-app-available-for-github-enterprise-server)."
|
||||
|
||||
If it is important for {% ifversion ghes %}other {% endif %}{% data variables.product.prodname_ghe_server %} users to be able to use your tool, consider using {% data variables.product.prodname_actions %} instead of a {% data variables.product.prodname_github_app %}. Public actions are available on {% data variables.product.prodname_ghe_server %} instances with GitHub Connect. For more information, see "[AUTOTITLE](/github-ae@latest/admin/github-actions/managing-access-to-actions-from-githubcom/enabling-automatic-access-to-githubcom-actions-using-github-connect)" and "[AUTOTITLE](/admin/github-actions/getting-started-with-github-actions-for-your-enterprise/about-github-actions-for-enterprises)."
|
||||
|
||||
For information about changing the visibility of a {% data variables.product.prodname_github_app %}, see "[AUTOTITLE](/apps/maintaining-github-apps/modifying-a-github-app)."
|
||||
For information about changing the visibility of a {% data variables.product.prodname_github_app %} registration, see "[AUTOTITLE](/apps/maintaining-github-apps/modifying-a-github-app)."
|
||||
|
||||
### Public installation flow
|
||||
|
||||
@@ -42,4 +43,4 @@ Public {% data variables.product.prodname_github_apps %} have a landing page wit
|
||||
|
||||
### Private installation flow
|
||||
|
||||
Private {% data variables.product.prodname_github_apps %} can only be installed on the user or organization account of the app owner. Limited information about the app will exist on a landing page for the app, but the **Install** button will only be available to organization owners and app managers for the organization that owns the app, or the personal account if the {% data variables.product.prodname_github_app %} is owned by an individual account.
|
||||
Private {% data variables.product.prodname_github_apps %} can only be installed on the user or organization account of the app owner. Limited information about the app will exist on a landing page for the app, but the **Install** button will only be available to organization owners and app managers for the organization that owns the app, or the personal account if the {% data variables.product.prodname_github_app %} is owned by an individual account.
|
||||
@@ -9,6 +9,7 @@ redirect_from:
|
||||
- /developers/apps/rate-limits-for-github-apps
|
||||
- /developers/apps/building-github-apps/rate-limits-for-github-apps
|
||||
- /apps/creating-github-apps/creating-github-apps/rate-limits-for-github-apps
|
||||
- /apps/creating-github-apps/setting-up-a-github-app/rate-limits-for-github-apps
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: Creating a GitHub App
|
||||
shortTitle: Create a {% data variables.product.prodname_github_app %}
|
||||
intro: 'You can create a {% data variables.product.prodname_github_app %} under your personal account or under any organization you own.'
|
||||
title: Registering a GitHub App
|
||||
shortTitle: 'Register a {% data variables.product.prodname_github_app %}'
|
||||
intro: 'You can register a {% data variables.product.prodname_github_app %} under your personal account or under any organization you own.'
|
||||
redirect_from:
|
||||
- /early-access/integrations/creating-an-integration
|
||||
- /apps/building-integrations/setting-up-and-registering-github-apps/registering-github-apps
|
||||
@@ -9,6 +9,8 @@ redirect_from:
|
||||
- /developers/apps/creating-a-github-app
|
||||
- /developers/apps/building-github-apps/creating-a-github-app
|
||||
- /apps/creating-github-apps/creating-github-apps/creating-a-github-app
|
||||
- /apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app
|
||||
- /apps/creating-github-apps/setting-up-a-github-app/registering-a-github-app
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
@@ -18,13 +20,13 @@ topics:
|
||||
- GitHub Apps
|
||||
---
|
||||
|
||||
## About creating {% data variables.product.prodname_github_apps %}
|
||||
## About registering {% data variables.product.prodname_github_apps %}
|
||||
|
||||
You can create a {% data variables.product.prodname_github_app %} owned by your personal account, by an organization that you own, or by an organization that has granted you permission to manage all apps owned by the organization. For more information, see "[AUTOTITLE](/organizations/managing-programmatic-access-to-your-organization/adding-github-app-managers-in-your-organization)."
|
||||
You can register a {% data variables.product.prodname_github_app %} under your personal account, under an organization that you own, or under an organization that has granted you permission to manage all apps owned by the organization. For more information, see "[AUTOTITLE](/organizations/managing-programmatic-access-to-your-organization/adding-github-app-managers-in-your-organization)."
|
||||
|
||||
{% data reusables.apps.maximum-github-apps-allowed %}
|
||||
|
||||
## Creating a {% data variables.product.prodname_github_app %}
|
||||
## Registering a {% data variables.product.prodname_github_app %}
|
||||
|
||||
{% data reusables.apps.settings-step %}
|
||||
{% data reusables.user-settings.developer_settings %}
|
||||
@@ -61,11 +63,13 @@ You can create a {% data variables.product.prodname_github_app %} owned by your
|
||||
|
||||
## Next steps
|
||||
|
||||
After creating a {% data variables.product.prodname_github_app %}, you will want to write code to make your {% data variables.product.prodname_github_app %} do something. For examples of how to write code, see:
|
||||
After registering a {% data variables.product.prodname_github_app %}, you will want to write code to make your {% data variables.product.prodname_github_app %} do something. For examples of how to write code, see:
|
||||
|
||||
- "[AUTOTITLE](/apps/creating-github-apps/writing-code-for-a-github-app/quickstart)"
|
||||
- "[AUTOTITLE](/apps/creating-github-apps/guides/building-a-github-app-that-responds-to-webhook-events)"
|
||||
- "[AUTOTITLE](/apps/creating-github-apps/guides/building-a-login-with-github-button-with-a-github-app)"
|
||||
- "[AUTOTITLE](/apps/creating-github-apps/guides/building-a-login-with-github-button-with-a-github-app)"
|
||||
- "[AUTOTITLE](/apps/creating-github-apps/guides/building-a-cli-with-a-github-app)"
|
||||
- "[AUTOTITLE](/apps/creating-github-apps/writing-code-for-a-github-app/making-authenticated-api-requests-with-a-github-app-in-a-github-actions-workflow)"
|
||||
|
||||
You should aim to follow best practices. For more information, see "[AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/best-practices-for-creating-a-github-app)."
|
||||
|
||||
@@ -11,6 +11,7 @@ topics:
|
||||
- GitHub Apps
|
||||
redirect_from:
|
||||
- /apps/creating-github-apps/creating-github-apps/using-webhooks-with-github-apps
|
||||
- /apps/creating-github-apps/setting-up-a-github-app/using-webhooks-with-github-apps
|
||||
---
|
||||
|
||||
## About webhooks and {% data variables.product.prodname_github_apps %}
|
||||
@@ -19,15 +20,15 @@ Webhooks enable your {% data variables.product.prodname_github_app %} to receive
|
||||
|
||||
You can configure your {% data variables.product.prodname_github_app %} to receive webhooks for specific events on {% data variables.product.prodname_dotcom %} and automatically take action on them. For more information about the types of webhooks you can receive, see "[AUTOTITLE](/webhooks-and-events/webhooks/webhook-events-and-payloads)."
|
||||
|
||||
To receive webhook events in your {% data variables.product.prodname_github_app %}, you must activate webhooks in the app settings and specify a webhook URL where {% data variables.product.prodname_dotcom %} will send the webhook payloads. For more information about creating and configuring a {% data variables.product.prodname_github_app %}, see "[AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app)."
|
||||
To receive webhook events in your {% data variables.product.prodname_github_app %}, you must enable webhooks for your {% data variables.product.prodname_github_app %} registration and specify a webhook URL where {% data variables.product.prodname_dotcom %} will send the webhook payloads.
|
||||
|
||||
If your app does not need to respond to webhooks or will only be used for authentication, you can turn off the webhook function in your app settings. You do not need to specify a webhook URL. For more information, see "[AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app)."
|
||||
If your {% data variables.product.prodname_github_app %} does not need to respond to webhooks or will only be used for authentication, you can turn off the webhook function for your {% data variables.product.prodname_github_app %} registration. You do not need to specify a webhook URL.
|
||||
|
||||
For information about changing the webhooks that a {% data variables.product.prodname_github_app %} subscribes to, see "[AUTOTITLE](/apps/maintaining-github-apps/modifying-a-github-app)."
|
||||
For more information about registering a {% data variables.product.prodname_github_app %}, see "[AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app)." For more information about changing the webhooks that a {% data variables.product.prodname_github_app %} registration subscribes to, see "[AUTOTITLE](/apps/maintaining-github-apps/modifying-a-github-app)."
|
||||
|
||||
## Choosing a webhook URL
|
||||
|
||||
When you activate webhooks in the settings for your {% data variables.product.prodname_github_app %}, you will need to specify a webhook URL. The webhook URL is the address of a web server that will receive the webhook event payloads sent to your {% data variables.product.prodname_github_app %}. The server can then take action based on the content of the payload. You should choose a web server that's appropriate for the volume of webhook traffic that your {% data variables.product.prodname_github_app %} will encounter.
|
||||
When you activate webhooks for your {% data variables.product.prodname_github_app %} registration, you will need to specify a webhook URL. The webhook URL is the address of a web server that will receive the webhook event payloads sent to your {% data variables.product.prodname_github_app %}. The server can then take action based on the content of the payload. You should choose a web server that's appropriate for the volume of webhook traffic that your {% data variables.product.prodname_github_app %} will encounter.
|
||||
|
||||
### Choosing a webhook URL for development and testing
|
||||
|
||||
@@ -39,7 +40,7 @@ You can use Smee to create a unique domain where {% data variables.product.prodn
|
||||
|
||||
1. To use Smee to create a unique domain, go to https://smee.io and click **Start a new channel**.
|
||||
1. On the Smee channel page, follow the instructions under "Use the CLI" to install and run the Smee client.
|
||||
1. To connect your Smee webhook URL to your {% data variables.product.prodname_github_app %}, enter your unique Smee domain in the "Webhook URL" field of your app settings. For more information, see "[AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app)."
|
||||
1. To connect your Smee webhook URL to your {% data variables.product.prodname_github_app %}, enter your unique Smee domain in the "Webhook URL" field on your {% data variables.product.prodname_github_app %} registration page. For more information, see "[AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app)" and "[AUTOTITLE](/apps/maintaining-github-apps/modifying-a-github-app)."
|
||||
|
||||
### Choosing a webhook URL for production
|
||||
|
||||
@@ -51,7 +52,7 @@ To handle a higher volume of webhook traffic for a large app in production, cons
|
||||
|
||||
Once you've configured your server to receive payloads, it will listen for any payload sent to the server. For security reasons, you should limit incoming requests to only those originating from {% data variables.product.prodname_dotcom %}. You can do that by creating a webhook secret for your app.
|
||||
|
||||
To create a webhook secret for your GitHub App, type a secret token in your app settings under "Webhook secret." You should choose a random string of text with high entropy. For more information about how to create a webhook secret in your app settings, see "[AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app)."
|
||||
To create a webhook secret for your GitHub App, type a secret token under "Webhook secret" on your {% data variables.product.prodname_github_app %} registration page. You should choose a random string of text with high entropy. For more information, see "[AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app)" and "[AUTOTITLE](/apps/maintaining-github-apps/modifying-a-github-app)."
|
||||
|
||||
After creating a webhook secret for your app, you will need to configure your server to securely store and validate the webhook secret token. For more information, see "[AUTOTITLE](/webhooks-and-events/webhooks/securing-your-webhooks)."
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
---
|
||||
title: About the user authorization callback URL
|
||||
intro: 'You can specify a URL that users will be redirected to after they authorize a {% data variables.product.prodname_github_app %}.'
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
ghae: '*'
|
||||
ghec: '*'
|
||||
topics:
|
||||
- GitHub Apps
|
||||
shortTitle: Callback URL
|
||||
redirect_from:
|
||||
- /apps/creating-github-apps/creating-github-apps/about-the-user-authorization-callback-url
|
||||
---
|
||||
|
||||
When you create a {% data variables.product.prodname_github_app %}, you can specify a callback URL. When you use the web application flow to generate a user access token in order to act on behalf of a user, users will be redirected to the callback URL after they authorize the app.
|
||||
|
||||
You can specify up to 10 callback URLs. If you specify multiple callback URLs, you can use the `redirect_uri` parameter when you prompt the user to authorize your app, to indicate which callback URL the user should be redirected to. If you do not specify `redirect_uri`, the first callback URL will be used. For more information about using the `redirect_uri` parameter, see "[AUTOTITLE](/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app)".
|
||||
|
||||
The callback URL is different from the setup URL. Users are redirected to the setup URL after they install an app. Users are redirected to the callback URL when they authorize an app via the web application flow. For more information, see "[AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/about-the-setup-url)."
|
||||
|
||||
For more information about generating user access tokens, see "[AUTOTITLE](/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app)". For more information about creating or modifying a {% data variables.product.prodname_github_app %}, see "[AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app)" and "[AUTOTITLE](/apps/maintaining-github-apps/modifying-a-github-app)."
|
||||
@@ -0,0 +1,58 @@
|
||||
---
|
||||
title: About writing code for a GitHub App
|
||||
shortTitle: About writing GitHub App code
|
||||
intro: 'You need to write code to add functionality to your {% data variables.product.prodname_github_app %}.'
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
ghae: '*'
|
||||
ghec: '*'
|
||||
topics:
|
||||
- GitHub Apps
|
||||
---
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Before you write code for a {% data variables.product.prodname_github_app %}, you should register a {% data variables.product.prodname_github_app %}. When you register a {% data variables.product.prodname_github_app %}, you select permissions for the app. These permissions dictate what the {% data variables.product.prodname_github_app %} can do. When you register an app, you also specify other settings, including which webhook events your {% data variables.product.prodname_github_app %} should receive. You can always change the settings for your {% data variables.product.prodname_github_app %} registration. For more information, see "[AUTOTITLE](/apps/creating-github-apps/registering-a-github-app/registering-a-github-app)" and "[AUTOTITLE](/apps/maintaining-github-apps/modifying-a-github-app)."
|
||||
|
||||
If you want your {% data variables.product.prodname_github_app %} to access repository and/or organization data, you need to install your {% data variables.product.prodname_github_app %}. For more information, see "[AUTOTITLE](/apps/using-github-apps/installing-your-own-github-app)."
|
||||
|
||||
## Writing code for a {% data variables.product.prodname_github_app %}
|
||||
|
||||
In order for your {% data variables.product.prodname_github_app %} to do something, you need to write code to add functionality to your {% data variables.product.prodname_github_app %}.
|
||||
|
||||
For tutorials about how to write code for a {% data variables.product.prodname_github_app %}, see:
|
||||
|
||||
- "[AUTOTITLE](/apps/creating-github-apps/writing-code-for-a-github-app/quickstart)"
|
||||
- "[AUTOTITLE](/apps/creating-github-apps/guides/building-a-github-app-that-responds-to-webhook-events)"
|
||||
- "[AUTOTITLE](/apps/creating-github-apps/guides/building-a-login-with-github-button-with-a-github-app)"
|
||||
- "[AUTOTITLE](/apps/creating-github-apps/guides/building-a-cli-with-a-github-app)"
|
||||
|
||||
You can use the credentials from your {% data variables.product.prodname_github_app %} registration to make authenticated requests to {% data variables.product.company_short %}'s APIs. For more information, see "[AUTOTITLE](/apps/creating-github-apps/authenticating-with-a-github-app/about-authentication-with-a-github-app)."
|
||||
|
||||
During development, you will likely use your personal computer or codespace to run your {% data variables.product.prodname_github_app %}. You may need to make some modifications to your {% data variables.product.prodname_github_app %} registration during development:
|
||||
|
||||
- If your app receives webhooks, you may want to use a webhook proxy URL to forward webhooks from GitHub to your computer or codespace. You will need to update the "Webhook URL" setting in your {% data variables.product.prodname_github_app %} registration to use your webhook proxy URL. For an example, see "[AUTOTITLE](/apps/creating-github-apps/guides/building-a-github-app-that-responds-to-webhook-events)."
|
||||
|
||||
- If your app uses the web application flow to authorize a user, you may want to update the "Callback URL" setting in your {% data variables.product.prodname_github_app %} registration to use a local callback URL. For an example, see "[AUTOTITLE](/apps/creating-github-apps/guides/building-a-login-with-github-button-with-a-github-app)."
|
||||
|
||||
## Next steps
|
||||
|
||||
Once you write the code for your {% data variables.product.prodname_github_app %}, you should ensure that it follows best practices. If necessary, remember to update your {% data variables.product.prodname_github_app %} registration. If your {% data variables.product.prodname_github_app %} needs to run on a server instead of a user's device, deploy your app to your server. Finally, you can share your {% data variables.product.prodname_github_app %} with other users and organizations.
|
||||
|
||||
|
||||
### Follow best practices
|
||||
|
||||
Before deploying your {% data variables.product.prodname_github_app %}, make sure you follow best practices. For example, make sure that your {% data variables.product.prodname_github_app %}'s credentials are secure. For more information, see "[AUTOTITLE](/apps/creating-github-apps/about-creating-github-apps/best-practices-for-creating-a-github-app)."
|
||||
|
||||
### Update your {% data variables.product.prodname_github_app %} registration
|
||||
|
||||
If you changed the {% data variables.product.prodname_github_app %} registration for development, make sure you update the registration to use production-ready values. For example, if you used a webhook proxy URL for development, you should update the "Webhook URL" field to use the URL where you want your {% data variables.product.prodname_github_app %} to receive webhooks during production.
|
||||
|
||||
### Deploy your {% data variables.product.prodname_github_app %}
|
||||
|
||||
Once you have written the code for your {% data variables.product.prodname_github_app %}, your code needs to run somewhere. If your app is a website or web app, you might host your app on a server like [Azure App Service](https://azure.microsoft.com/products/app-service/). If your app is a client-side app, it might run on a user's device.
|
||||
|
||||
### Share your {% data variables.product.prodname_github_app %}
|
||||
|
||||
If you want to share your {% data variables.product.prodname_github_app %} with other users and organizations, you should make your {% data variables.product.prodname_github_app %} public. {% ifversion fpt or ghec %}To make your {% data variables.product.prodname_github_app %} more discoverable, you can list it on {% data variables.product.prodname_marketplace %}. {% endif %}For more information, see "[AUTOTITLE](/apps/sharing-github-apps/sharing-your-github-app)."
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
title: Building a CLI with a GitHub App
|
||||
shortTitle: Build a CLI
|
||||
intro: "Follow this tutorial to write a CLI in Ruby that generates a user access token for a {% data variables.product.prodname_github_app %} via the device flow."
|
||||
intro: 'Follow this tutorial to write a CLI in Ruby that generates a user access token for a {% data variables.product.prodname_github_app %} via the device flow.'
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
@@ -9,6 +9,8 @@ versions:
|
||||
ghec: '*'
|
||||
topics:
|
||||
- GitHub Apps
|
||||
redirect_from:
|
||||
- /apps/creating-github-apps/guides/building-a-cli-with-a-github-app
|
||||
---
|
||||
|
||||
## Introduction
|
||||
@@ -33,7 +35,7 @@ There are two ways to generate a user access token for a {% data variables.produ
|
||||
|
||||
## Prerequisites
|
||||
|
||||
This tutorial assumes that you have already created a {% data variables.product.prodname_github_app %}. For more information about creating an app, see "[AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app)."
|
||||
This tutorial assumes that you have already registered a {% data variables.product.prodname_github_app %}. For more information about registering a {% data variables.product.prodname_github_app %}, see "[AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app)."
|
||||
|
||||
Before following this tutorial, you must enable device flow for your app. For more information about enabling device flow for your app, see "[AUTOTITLE](/apps/maintaining-github-apps/modifying-a-github-app)."
|
||||
|
||||
@@ -9,6 +9,8 @@ versions:
|
||||
ghec: '*'
|
||||
topics:
|
||||
- GitHub Apps
|
||||
redirect_from:
|
||||
- /apps/creating-github-apps/guides/building-a-github-app-that-responds-to-webhook-events
|
||||
---
|
||||
## Introduction
|
||||
|
||||
@@ -20,9 +22,9 @@ This tutorial uses JavaScript, but you can use any programming language that you
|
||||
|
||||
### About webhooks
|
||||
|
||||
When you create a {% data variables.product.prodname_github_app %}, you can specify a webhook URL and subscribe to webhook events. When activity on {% data variables.product.company_short %} triggers an event that your app is subscribed to, {% data variables.product.company_short %} will send a webhook event to your app's webhook URL.
|
||||
When you register a {% data variables.product.prodname_github_app %}, you can specify a webhook URL and subscribe to webhook events. When activity on {% data variables.product.company_short %} triggers an event that your app is subscribed to, {% data variables.product.company_short %} will send a webhook event to your app's webhook URL.
|
||||
|
||||
For example, you can subscribe your app to the pull request webhook event. When a pull request is opened in a repository that the app was granted access to, {% data variables.product.company_short %} will send a pull request webhook event to your app's webhook URL. If multiple actions can trigger the event, the event payload will include an `action` field to indicate what type of action triggered the event. In this example, the value of `action` would be `opened` since the event was triggered because a pull request was opened.
|
||||
For example, you can subscribe your {% data variables.product.prodname_github_app %} to the pull request webhook event. When a pull request is opened in a repository that the app was granted access to, {% data variables.product.company_short %} will send a pull request webhook event to your app's webhook URL. If multiple actions can trigger the event, the event payload will include an `action` field to indicate what type of action triggered the event. In this example, the value of `action` would be `opened` since the event was triggered because a pull request was opened.
|
||||
|
||||
If your app is running on a server that is listening for these webhook events, then your app can take an action when it receives a webhook event. For example, your app can use the {% data variables.product.company_short %} API to post a comment to the pull request when it receives a pull request webhook event.
|
||||
|
||||
@@ -40,7 +42,7 @@ The following sections will lead you through setting up the following components
|
||||
|
||||
- a repository to store the code for your app
|
||||
- a way to receive webhooks locally
|
||||
- a {% data variables.product.prodname_github_app %} that is subscribed to "pull request" webhook events, has permission to add comments to pull requests, and uses a webhook URL that you can receive locally
|
||||
- a {% data variables.product.prodname_github_app %} registration that is subscribed to "pull request" webhook events, has permission to add comments to pull requests, and uses a webhook URL that you can receive locally
|
||||
|
||||
### Create a repository to store code for your app
|
||||
|
||||
@@ -59,16 +61,16 @@ In order to develop your app locally, you can use a webhook proxy URL to forward
|
||||
1. Click **Start a new channel**.
|
||||
1. Copy the full URL under "Webhook Proxy URL". You will use this URL in a later step.
|
||||
|
||||
### Create a {% data variables.product.prodname_github_app %}
|
||||
### Register a {% data variables.product.prodname_github_app %}
|
||||
|
||||
For this tutorial, you must have a {% data variables.product.prodname_github_app %} that:
|
||||
For this tutorial, you must have a {% data variables.product.prodname_github_app %} registration that:
|
||||
|
||||
- Has webhooks active
|
||||
- Uses a webhook URL that you can receive locally
|
||||
- Has the "Pull request" repository permission
|
||||
- Subscribes to the "Pull request" webhook event
|
||||
|
||||
The following steps will guide you through configuring a {% data variables.product.prodname_github_app %} with these settings. For more information about {% data variables.product.prodname_github_app %} settings, see "[AUTOTITLE](/apps/creating-github-apps/creating-github-apps/creating-a-github-app)."
|
||||
The following steps will guide you through registering a {% data variables.product.prodname_github_app %} with these settings. For more information about {% data variables.product.prodname_github_app %} settings, see "[AUTOTITLE](/apps/creating-github-apps/creating-github-apps/creating-a-github-app)."
|
||||
|
||||
{% data reusables.apps.settings-step %}
|
||||
{% data reusables.user-settings.developer_settings %}
|
||||
@@ -11,6 +11,7 @@ topics:
|
||||
- GitHub Apps
|
||||
redirect_from:
|
||||
- /apps/creating-github-apps/guides/using-the-web-application-flow-to-generate-a-user-access-token-for-a-github-app
|
||||
- /apps/creating-github-apps/guides/building-a-login-with-github-button-with-a-github-app
|
||||
---
|
||||
|
||||
## Introduction
|
||||
@@ -27,7 +28,7 @@ There are two ways to generate a user access token for a {% data variables.produ
|
||||
|
||||
## Prerequisites
|
||||
|
||||
This tutorial assumes that you have already created a {% data variables.product.prodname_github_app %}. For more information about creating an app, see "[AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app)."
|
||||
This tutorial assumes that you have already registered a {% data variables.product.prodname_github_app %}. For more information about registering a {% data variables.product.prodname_github_app %}, see "[AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app)."
|
||||
|
||||
Before following this tutorial, you must set a callback URL for your app. This tutorial uses a local Sinatra server with the default URL of `http://localhost:4567`. For example, to work with the default URL for a local Sinatra application, your callback URL can be `http://localhost:4567/github/callback`. Once you are ready to deploy your app, you can change the callback URL to use your live server address. For more information about updating the callback URL for your app, see "[AUTOTITLE](/apps/maintaining-github-apps/modifying-a-github-app)" and "[AUTOTITLE](/apps/creating-github-apps/setting-up-a-github-app/about-the-user-authorization-callback-url)."
|
||||
|
||||
@@ -5,6 +5,7 @@ redirect_from:
|
||||
- /apps/quickstart-guides/creating-ci-tests-with-the-checks-api
|
||||
- /developers/apps/creating-ci-tests-with-the-checks-api
|
||||
- /developers/apps/guides/creating-ci-tests-with-the-checks-api
|
||||
- /apps/creating-github-apps/guides/creating-ci-tests-with-the-checks-api
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
@@ -1,9 +1,10 @@
|
||||
---
|
||||
title: Guides
|
||||
title: Writing code for a GitHub App
|
||||
intro: 'Learn about using the {% ifversion fpt or ghec %}{% data variables.product.prodname_dotcom %}{% else %}{% data variables.product.product_name %}{% endif %} API with your app, continuous integration, and how to build with apps.'
|
||||
redirect_from:
|
||||
- /apps/quickstart-guides
|
||||
- /developers/apps/guides
|
||||
- /apps/creating-github-apps/guides
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
@@ -12,11 +13,11 @@ versions:
|
||||
topics:
|
||||
- GitHub Apps
|
||||
children:
|
||||
- /about-writing-code-for-a-github-app
|
||||
- /quickstart
|
||||
- /building-a-github-app-that-responds-to-webhook-events
|
||||
- /building-a-login-with-github-button-with-a-github-app
|
||||
- /building-a-cli-with-a-github-app
|
||||
- /making-authenticated-api-requests-with-a-github-app-in-a-github-actions-workflow
|
||||
- /setting-up-your-development-environment-to-create-a-github-app
|
||||
- /using-the-github-api-in-your-app
|
||||
- /creating-ci-tests-with-the-checks-api
|
||||
@@ -10,6 +10,8 @@ versions:
|
||||
ghec: '*'
|
||||
topics:
|
||||
- GitHub Apps
|
||||
redirect_from:
|
||||
- /apps/creating-github-apps/guides/quickstart
|
||||
---
|
||||
|
||||
## Introduction
|
||||
@@ -40,7 +42,7 @@ In order to develop your app locally, you can use a webhook proxy URL to forward
|
||||
1. Click **Start a new channel**.
|
||||
1. Copy the full URL under "Webhook Proxy URL". You will use this URL in a later step.
|
||||
|
||||
## Step 3: Create a {% data variables.product.prodname_github_app %}
|
||||
## Step 3: Register a {% data variables.product.prodname_github_app %}
|
||||
|
||||
The following steps will guide you through configuring the app settings that are required for this quickstart. For more information about the settings, see "[AUTOTITLE](/apps/creating-github-apps/creating-github-apps/creating-a-github-app)."
|
||||
|
||||
@@ -5,6 +5,7 @@ redirect_from:
|
||||
- /apps/quickstart-guides/setting-up-your-development-environment
|
||||
- /developers/apps/setting-up-your-development-environment-to-create-a-github-app
|
||||
- /developers/apps/getting-started-with-apps/setting-up-your-development-environment-to-create-a-github-app
|
||||
- /apps/creating-github-apps/guides/setting-up-your-development-environment-to-create-a-github-app
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
@@ -6,6 +6,7 @@ redirect_from:
|
||||
- /apps/quickstart-guides/using-the-github-api-in-your-app
|
||||
- /developers/apps/using-the-github-api-in-your-app
|
||||
- /developers/apps/guides/using-the-github-api-in-your-app
|
||||
- /apps/creating-github-apps/guides/using-the-github-api-in-your-app
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghes: '*'
|
||||
Reference in New Issue
Block a user