About GitHub 应用程序 URL parameters
You can add query parameters to these URLs to preselect the configuration of a GitHub 应用程序 on a personal or organization account:
- User account:
https://github.com/settings/apps/new
- Organization account:
https://github.com/organizations/:org/settings/apps/new
The person creating the app can edit the preselected values from the GitHub 应用程序 registration page, before submitting the app. If you do not include required parameters in the URL query string, like name
, the person creating the app will need to input a value before submitting the app.
The following URL creates a new public app called octocat-github-app
with a preconfigured description and callback URL. This URL also selects read and write permissions for checks
, subscribes to the check_run
and check_suite
webhook events, and selects the option to request user authorization (OAuth) during installation:
https://github.com/settings/apps/new?name=octocat-github-app&description=An%20Octocat%20App&callback_url=https://example.com&request_oauth_on_install=true&public=true&checks=write&events[]=check_run&events[]=check_suite
The complete list of available query parameters, permissions, and events is listed in the sections below.
GitHub 应用程序 configuration parameters
名称 | 类型 | 描述 |
---|---|---|
name | 字符串 | The name of the GitHub 应用程序. Give your app a clear and succinct name. Your app cannot have the same name as an existing GitHub user, unless it is your own user or organization name. A slugged version of your app's name will be shown in the user interface when your integration takes an action. |
说明 | 字符串 | A description of the GitHub 应用程序. |
url | 字符串 | The full URL of your GitHub 应用程序's website homepage. |
callback_url | 字符串 | The full URL to redirect to after someone authorizes an installation. This URL is used if your app needs to identify and authorize user-to-server requests. |
request_oauth_on_install | boolean | If your app authorizes users using the OAuth flow, you can set this option to true to allow people to authorize the app when they install it, saving a step. If you select this option, the setup_url becomes unavailable and users will be redirected to your callback_url after installing the app. |
setup_url | 字符串 | The full URL to redirect to after someone installs the GitHub 应用程序 if the app requires additional setup after installation. |
setup_on_update | boolean | Set to true to redirect people to the setup URL when installations have been updated, for example, after repositories are added or removed. |
public | boolean | Set to true when your GitHub 应用程序 is available to the public or false when it is only accessible to the owner of the app. |
webhook_url | 字符串 | The full URL that you would like to send webhook event payloads to. |
webhook_secret | 字符串 | You can specify a secret to secure your webhooks. See "Securing your webhooks" for more details. |
事件 | 字符串数组 | Web 挂钩事件. Some webhook events require read or write permissions for a resource before you can select the event when registering a new GitHub 应用程序. See the "GitHub 应用程序 webhook events" section for available events and their required permissions. You can select multiple events in a query string. For example, events[]=public&events[]=label . |
域 | 字符串 | The URL of a content reference. |
single_file_name | 字符串 | When you grant read or write access to the single_file permission, this field provides the path to the single file your GitHub 应用程序 will manage. |
GitHub 应用程序 permissions
You can select permissions in a query string using the permission name in the following table as the query parameter name and the permission type as the query value. For example, to select Read & write
permissions in the user interface for contents
, your query string would include &contents=write
. To select Read-only
permissions in the user interface for blocking
, your query string would include &blocking=read
. To select no-access
in the user interface for checks
, your query string would not include the checks
permission.
权限 | Description |
---|---|
管理 | Grants access to various endpoints for organization and repository administration. Can be one of: none , read , or write . |
检查 | Grants access to the Checks API. Can be one of: none , read , or write . |
content_references | Grants access to the "Create a content attachment" endpoint. Can be one of: none , read , or write . |
内容 | Grants access to various endpoints that allow you to modify repository contents. Can be one of: none , read , or write . |
部署 | Grants access to the Deployments API. Can be one of: none , read , or write . |
emails | Grants access to the Emails API. Can be one of: none , read , or write . |
关注者 | Grants access to the Followers API. Can be one of: none , read , or write . |
gpg_keys | Grants access to the GPG Keys API. Can be one of: none , read , or write . |
议题 | Grants access to the Issues API. Can be one of: none , read , or write . |
键 | Grants access to the Public Keys API. Can be one of: none , read , or write . |
members | Grants access to manage an organization's members. Can be one of: none , read , or write . |
organization_hooks | Grants access to the Organization Webhooks API. Can be one of: none , read , or write . |
organization_plan | Grants access to get information about an organization's plan using the "Get an organization" endpoint. Can be one of: none or read . |
organization_projects | Grants access to the Projects API. Can be one of: none , read , write , or admin . |
页面 | Grants access to the Pages API. Can be one of: none , read , or write . |
plan | Grants access to get information about a user's GitHub plan using the "Get a user" endpoint. Can be one of: none or read . |
pull_requests | Grants access to various pull request endpoints. Can be one of: none , read , or write . |
repository_hooks | Grants access to the Repository Webhooks API. Can be one of: none , read , or write . |
repository_projects | Grants access to the Projects API. Can be one of: none , read , write , or admin . |
single_file | Grants access to the Contents API. Can be one of: none , read , or write . |
标星 | Grants access to the Starring API. Can be one of: none , read , or write . |
状态 | Grants access to the Statuses API. Can be one of: none , read , or write . |
team_discussions | Grants access to the Team Discussions API and the Team Discussion Comments API. Can be one of: none , read , or write . |
vulnerability_alerts | Grants access to receive security alerts for vulnerable dependencies in a repository. See "About security alerts for vulnerable dependencies" to learn more. Can be one of: none or read . |
关注 | Grants access to list and change repositories a user is subscribed to. Can be one of: none , read , or write . |
GitHub 应用程序 webhook events
Web 挂钩事件名称 | Required permission | 描述 |
---|---|---|
check_run | 检查 | Check run activity has occurred. The type of activity is specified in the action property of the payload object. For more information, see the "check runs" REST API. |
check_suite | 检查 | Check suite activity has occurred. The type of activity is specified in the action property of the payload object. For more information, see the "check suites" REST API. |
commit_comment | 内容 | A commit comment is created. The type of activity is specified in the action property of the payload object. For more information, see the "commit comment" REST API. |
content_reference | content_references | A new content reference is created . A new content reference is created when the body or comment of an issue or pull request includes a URL that matches a configured content reference domain. For more information, see "Using content attachments" to learn more about content references and attachments. |
create | 内容 | A Git branch or tag is created. For more information, see the "Git data" REST API. |
delete | 内容 | A Git branch or tag is deleted. For more information, see the "Git data" REST API. |
deployment | 部署 | A deployment is created. The type of activity is specified in the action property of the payload object. For more information, see the "deployment" REST API. |
deployment_status | 部署 | A deployment is created. The type of activity is specified in the action property of the payload object. For more information, see the "deployment statuses" REST API. |
复刻 | 内容 | A user forks a repository. For more information, see the "forks" REST API. |
gollum | 内容 | A wiki page is created or updated. For more information, see the "About wikis". |
议题 | 议题 | Activity related to an issue. The type of activity is specified in the action property of the payload object. For more information, see the "issues" REST API. |
issue_comment | 议题 | Activity related to an issue comment. The type of activity is specified in the action property of the payload object. For more information, see the "issue comments" REST API. |
标签 | 元数据 | Activity related to an issue. The type of activity is specified in the action property of the payload object. For more information, see the "labels" REST API. |
member | members | Activity related to repository collaborators. The type of activity is specified in the action property of the payload object. For more information, see the "collaborators" REST API. |
membership | members | Activity related to team membership. The type of activity is specified in the action property of the payload object. For more information, see the "team members" REST API. |
里程碑 | pull_request | Activity related to milestones. The type of activity is specified in the action property of the payload object. For more information, see the "milestones" REST API. |
组织 | members | Activity related to an organization and its members. The type of activity is specified in the action property of the payload object. For more information, see the "organizations" REST API. |
page_build | 页面 | Represents an attempted build of a GitHub Pages site, whether successful or not. A push to a GitHub Pages enabled branch (gh-pages for project pages, master for user and organization pages) triggers this event. |
project | repository_projects or organization_projects | Activity related to project boards. The type of activity is specified in the action property of the payload object. For more information, see the "projects" REST API. |
project_card | repository_projects or organization_projects | Activity related to project cards. The type of activity is specified in the action property of the payload object. For more information, see the "project cards" REST API. |
project_column | repository_projects or organization_projects | Activity related to columns in a project board. The type of activity is specified in the action property of the payload object. For more information, see the "project columns" REST API. |
public | 元数据 | When a private repository is made public. Without a doubt: the best GitHub Enterprise event. |
pull_request | pull_requests | Activity related to pull requests. The type of activity is specified in the action property of the payload object. For more information, see the "pull requests" REST API. |
pull_request_review | pull_request | Activity related to pull request reviews. The type of activity is specified in the action property of the payload object. For more information, see the "pull request reviews" REST API. |
pull_request_review_comment | pull_request | Activity related to pull request review comments in the pull request's unified diff. The type of activity is specified in the action property of the payload object. For more information, see the "pull request review comments" REST API. |
推送 | 内容 | One or more commits are pushed to a repository branch or tag. |
发行版 | 内容 | Activity related to a release. The type of activity is specified in the action property of the payload object. For more information, see the "releases" REST API. |
仓库 | 元数据 | Activity related to a repository. The type of activity is specified in the action property of the payload object. For more information, see the "repositories" REST API. |
状态 | 状态 | When the status of a Git commit changes. The type of activity is specified in the action property of the payload object. For more information, see the "statuses" REST API. |
团队 | members | Activity related to an organization's team. The type of activity is specified in the action property of the payload object. For more information, see the "teams" REST API. |
team_add | members | When a repository is added to a team. |
查看 | 元数据 | When someone stars a repository. The type of activity is specified in the action property of the payload object. For more information, see the "starring" REST API. |