ドキュメントには頻繁に更新が加えられ、その都度公開されています。本ページの翻訳はまだ未完成な部分があることをご了承ください。最新の情報については、英語のドキュメンテーションをご参照ください。本ページの翻訳に問題がある場合はこちらまでご連絡ください。

このバージョンの GitHub Enterprise はこの日付をもって終了となりました: 2020-11-12. 重大なセキュリティの問題に対してであっても、パッチリリースは作成されません。 パフォーマンスの向上、セキュリティの改善、新機能のためには、最新バージョンのGitHub Enterpriseにアップグレードしてください。 アップグレードに関する支援については、GitHub Enterprise supportに連絡してください。

URL パラメータを使用して GitHub App を作成する

新しい GitHub App の構成を迅速に設定するため、URL クエリパラメータ を使用して新しい GitHub App の設定を事前設定できます。

ここには以下の内容があります:

GitHub App URL パラメータについて

個人または Organization アカウントで、GitHub App の構成を事前設定する以下の URL をクエリパラメータに追加できます。

  • ユーザアカウント: http(s)://[hostname]/settings/apps/new
  • Organization アカウント: http(s)://[hostname]/:org/settings/apps/new

アプリケーションを作成するユーザは、アプリケーションをサブミットする前に GitHub App 登録ページから事前設定する値を編集できます。 URL クエリ文字列に name などの必須の値を含めない場合、アプリケーションを作成するユーザが、アプリケーションをサブミットする前に値を入力する必要があります。

以下の URL は、説明とコールバック URL が事前設定された、octocat-github-app という新しい公開アプリケーションを作成します。 また、この URL はchecks の読み取りおよび書き込み権限を選択し、check_run および check_suite webhook イベントにサブスクライブし、インストール時にユーザの認可 (OAuth) をリクエストするオプションを選択します。

http(s)://[hostname]/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

使用可能なクエリパラメータ、権限、およびイベントの完全なリストを、以下のセクションに記載します。

GitHub App configuration parameters

名前種類説明
namestringGitHub App の名前。 アプリケーションには簡潔で明快な名前を付けましょう。 アプリケーションの名前は、既存の GitHub ユーザと同じ名前にできません。ただし、その名前があなた自身のユーザ名や Organization 名である場合は例外です。 インテグレーションが動作すると、ユーザインターフェース上にアプリケーション名のスラッグが表示されます。
descriptionstringGitHub App の説明。
urlstringGitHub App のホームページの完全な URL。
callback_urlstringインストールの承認後にリダイレクトする完全な URL。 この URL は、アプリケーションがユーザからサーバへのリクエストを識別して承認する必要がある場合に使用されます。
request_oauth_on_installbooleanアプリケーションが OAuth フローを使用してユーザを認可する場合、このオプションを true にして、インストール時にアプリケーションを認可し、ステップを省略するように設定できます。 このオプションを選択した場合、setup_url が利用できなくなり、アプリケーションのインストール後はあなたが設定した callback_url にリダイレクトされます。
setup_urlstringGitHub App アプリケーションをインストール後に追加セットアップが必要な場合に、リダイレクトする完全な URL。
setup_on_updatebooleantrue に設定すると、たとえばリポジトリが追加や削除された後など、インストールしたアプリケーションが更新された場合に、ユーザをセットアップ URL にリダイレクトします。
publicbooleanGitHub App を公開する場合には true に、アプリケーションの所有者のみがアクセスできるようにするには false を設定。
webhook_urlstringwebhook イベントペイロードを送信する完全な URL。
webhook_secretstringwebhook を保護するためのシークレットを指定できます。 詳細は「webhook を保護する」を参照。
eventsarray of stringswebhook イベント. 一部の webhook イベントでは、新しい GitHub App を登録する際、イベントを選択するためにread または write 権限が必要です。 利用可能なイベントと、それに必要な権限については、「GitHub App webhook イベント」セクションを参照してください。 クエリ文字列では、複数のイベントを選択できます。 たとえば、events[]=public&events[]=label とできます。
domainstringコンテンツ参照の URL。
single_file_namestringこれは、アプリケーションが任意のリポジトリの単一のファイルにアクセスできるようにするための、スコープの狭い権限です。 single_file 権限を read または write に設定すると、このフィールドは GitHub App が扱う単一のファイルへのパスを指定します。

GitHub App の権限

以下の表にある権限名をクエリパラメータ名として、権限タイプをクエリの値として使用することで、クエリ文字列で権限を設定できます。 たとえば、contents のユーザインターフェースに Read & write 権限を設定するには、クエリ文字列に &contents=write を含めます。 blocking のユーザインターフェースに Read-only 権限を設定するには、クエリ文字列に &blocking=read を含めます。 checks のユーザインターフェースに no-access を設定するには、クエリ文字列に checks 権限を含めないようにします。

権限説明
administrationOrganization およびリポジトリ管理のためのさまざまなエンドポイントにアクセス権を付与します。 nonereadwrite のいずれかです。
checksChecks API へのアクセス権を付与します。 nonereadwrite のいずれかです。
content_referencesコンテンツ添付の作成」エンドポイントへのアクセス権を付与します。 nonereadwrite のいずれかです。
contentsさまざまなエンドポイントにアクセス権を付与し、リポジトリのコンテンツを変更できるようにします。 nonereadwrite のいずれかです。
deploymentsDeployments API へのアクセス権を付与します。 nonereadwrite のいずれかです。
emailsEmails API へのアクセス権を付与します。 nonereadwrite のいずれかです。
followersFollowers API へのアクセス権を付与します。 nonereadwrite のいずれかです。
gpg_keysGPG Keys API へのアクセス権を付与します。 nonereadwrite のいずれかです。
issuesIssues API へのアクセス権を付与します。 nonereadwrite のいずれかです。
keysPublic Keys API へのアクセス権を付与します。 nonereadwrite のいずれかです。
membersOrganization のメンバーへのアクセス権を付与します。 nonereadwrite のいずれかです。
organization_hooksOrganization Webhooks API へのアクセス権を付与します。 nonereadwrite のいずれかです。
organization_planOrganization の取得」エンドポイントを使用して Organization のプランについての情報を取得するためのアクセス権を付与します。 noneread のいずれかです。
organization_projectsProjects API へのアクセス権を付与します。 nonereadwriteadmin のいずれかです。
pagesPages API へのアクセス権を付与します。 nonereadwrite のいずれかです。
planユーザの取得」エンドポイントを使用してユーザの GitHub プランについての情報を取得するためのアクセス権を付与します。 noneread のいずれかです。
pull_requestsさまざまなプルリクエストエンドポイントへのアクセス権を付与します。 nonereadwrite のいずれかです。
repository_hooksRepository Webhooks API へのアクセス権を付与します。 nonereadwrite のいずれかです。
repository_projectsProjects API へのアクセス権を付与します。 nonereadwriteadmin のいずれかです。
single_fileContents API へのアクセス権を付与します。 nonereadwrite のいずれかです。
starringStarring API へのアクセス権を付与します。 nonereadwrite のいずれかです。
statusesStatuses API へのアクセス権を付与します。 nonereadwrite のいずれかです。
team_discussionsTeam Discussions API および Team Discussion Comments API へのアクセス権を付与します。 nonereadwrite のいずれかです。
vulnerability_alertsリポジトリ内の脆弱性のある依存関係に対するセキュリティアラートを受信するためのアクセス権を付与します。 詳細は「脆弱性のある依存関係に対するセキュリティアラートについて」を参照。 noneread のいずれかです。
Watchリストへのアクセス権を付与し、ユーザがサブスクライブするリポジトリの変更を許可します。 nonereadwrite のいずれかです。

GitHub App webhook イベント

Webhook イベント名必要な権限説明
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_referencecontent_referencesA 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.
forkコンテンツ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".
issuesissuesActivity 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_commentissuesActivity 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.
labelメタデータ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.
membermembersActivity 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.
membershipmembersActivity 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.
milestonepull_requestActivity 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.
OrganizationmembersActivity 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_buildpagesRepresents 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, the default branch for user and organization pages) triggers this event.
projectrepository_projects または organization_projectsActivity 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_cardrepository_projects または organization_projectsActivity 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_columnrepository_projects または organization_projectsActivity 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 Server event.
pull_requestpull_requestsActivity 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_reviewpull_requestActivity 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_commentpull_requestActivity 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.
pushコンテンツOne or more commits are pushed to a repository branch or tag.
releaseコンテンツ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.
repositoryメタデータ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.
statusステータス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.
TeammembersActivity 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_addmembersリポジトリがTeamに追加された
Watchメタデータ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.