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

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

記事のバージョン: Enterprise Server 2.18

GitHub event types

For the GitHub Events API, learn about each event type, the triggering action on GitHub, and each event's unique properties.

Enterpriseアカウントは、GitHub Enterprise Cloud及びGitHub Enterprise Serverで利用できます。

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

The Events API can return different types of events triggered by activity on GitHub. Each event response contains shared properties, but has a unique payload object determined by its event type. The Event object common properties describes the properties shared by all events, and each event type describes the payload properties that are unique to the specific event.

Event object common properties

The event objects returned from the Events API endpoints have the same structure.

Event API attribute name説明
idUnique identifier for the event.
typeThe type of event. Events uses PascalCase for the name.
actorThe user that triggered the event.
actor.idThe unique identifier for the actor.
actor.loginThe username of the actor.
actor.display_loginThe specific display format of the username.
actor.gravatar_idThe unique indentifier of the Gravatar profile for the actor.
actor.urlThe REST API URL used to retrieve the user object, which includes additional user information.
actor.avatar_urlThe URL of the actor's profile image.
repoThe repository object where the event occurred.
repo.idThe unique identifier of the repository.
repo.nameThe name of the repository, which includes the owner and repository name. For example, octocat/hello-world is the name of the hello-world repository owned by the octocat user account.
repo.urlThe REST API URL used to retrive the repository object, which includes additional repository information.
payloadThe event payload object is unique to the event type. See the event type below for the event API payload object.

Example WatchEvent event object

This example shows the format of the WatchEvent response when using the Events API.

Status: 200 OK
Link: <https://api.github.com/resource?page=2>; rel="next",
      <https://api.github.com/resource?page=5>; rel="last"
[
  {
    "type": "WatchEvent",
    "public": true,
    "payload": {
    },
    "repo": {
      "id": 3,
      "name": "octocat/Hello-World",
      "url": "https://api.github.com/repos/octocat/Hello-World"
    },
    "actor": {
      "id": 1,
      "login": "octocat",
      "gravatar_id": "",
      "avatar_url": "https://github.com/images/error/octocat_happy.gif",
      "url": "https://api.github.com/users/octocat"
    },
    "org": {
      "id": 1,
      "login": "github",
      "gravatar_id": "",
      "url": "https://api.github.com/orgs/github",
      "avatar_url": "https://github.com/images/error/octocat_happy.gif"
    },
    "created_at": "2011-09-06T17:26:27Z",
    "id": "12345"
  }
]

CommitCommentEvent

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.

The event object includes properties that are common for all events. Each event object includes a payload property and the value is unique to each event type. The payload object for this event is described below.

Event payload object

キー種類説明
actionstring実行されたアクション。 created になりうる。
commentobjectcommit commentリソース。

CreateEvent

A Git branch or tag is created. For more information, see the "Git data" REST API.

The event object includes properties that are common for all events. Each event object includes a payload property and the value is unique to each event type. The payload object for this event is described below.

Event payload object

キー種類説明
refstringgit refリソース。
ref_typestringリポジトリで作成されたGit refオブジェクトの種類。 branchもしくはtagになる。
master_branchstringリポジトリのデフォルトブランチの名前(通常はmaster)。
descriptionstringリポジトリの現在の説明。

DeleteEvent

A Git branch or tag is deleted. For more information, see the "Git data" REST API.

The event object includes properties that are common for all events. Each event object includes a payload property and the value is unique to each event type. The payload object for this event is described below.

Event payload object

キー種類説明
refstringgit refリソース。
ref_typestringリポジトリで削除されたGit refオブジェクトの種類。 branchもしくはtagになる。

ForkEvent

A user forks a repository. For more information, see the "forks" REST API.

The event object includes properties that are common for all events. Each event object includes a payload property and the value is unique to each event type. The payload object for this event is described below.

Event payload object

キー種類説明
forkeeオブジェクトThe created repository resource.

GollumEvent

A wiki page is created or updated. For more information, see the "About wikis".

The event object includes properties that are common for all events. Each event object includes a payload property and the value is unique to each event type. The payload object for this event is described below.

Event payload object

キー種類説明
ページ配列The pages that were updated.
pages[][page_name]stringThe name of the page.
pages[][title]stringThe current page title.
pages[][action]stringThe action that was performed on the page. Can be created or edited.
pages[][sha]stringThe latest commit SHA of the page.
pages[][html_url]stringPoints to the HTML wiki page.

IssueCommentEvent

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.

The event object includes properties that are common for all events. Each event object includes a payload property and the value is unique to each event type. The payload object for this event is described below.

Event payload object

キー種類説明
actionstringThe action that was performed on the comment. Can be one of created, edited, or deleted.
changesobjectThe changes to the comment if the action was edited. changes[body][from]

IssuesEvent

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.

The event object includes properties that are common for all events. Each event object includes a payload property and the value is unique to each event type. The payload object for this event is described below.

Event payload object

キー種類説明
actionstring実行されたアクション. Can be one of opened, closed, reopened, assigned, unassigned, labeled, or unlabeled.
issueobjectThe issue itself. changes

MemberEvent

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.

The event object includes properties that are common for all events. Each event object includes a payload property and the value is unique to each event type. The payload object for this event is described below.

Event payload object

キー種類説明
actionstring実行されたアクション. Can be added to indicate a user accepted an invitation to a repository.
memberobjectThe user that was added. changes

PublicEvent

When a private repository is made public. Without a doubt: the best GitHub Enterprise event.

Event payload object

This event returns an empty payload object.

PullRequestEvent

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.

The event object includes properties that are common for all events. Each event object includes a payload property and the value is unique to each event type. The payload object for this event is described below.

Event payload object

キー種類説明
actionstring実行されたアクション. Can be one of opened, closed, reopened, assigned, unassigned, review_requested, review_request_removed, labeled, unlabeled, and synchronize.
numberintegerThe pull request number. changes

PullRequestReviewCommentEvent

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.

The event object includes properties that are common for all events. Each event object includes a payload property and the value is unique to each event type. The payload object for this event is described below.

Event payload object

キー種類説明
actionstringThe action that was performed on the comment. created になりうる。
changesobjectThe changes to the comment if the action was edited. changes[body][from]

PushEvent

One or more commits are pushed to a repository branch or tag.

The event object includes properties that are common for all events. Each event object includes a payload property and the value is unique to each event type. The payload object for this event is described below.

キー種類説明
push_idintegerUnique identifier for the push.
sizeintegerThe number of commits in the push.
distinct_sizeintegerThe number of distinct commits in the push.
refstringThe full git ref that was pushed. Example: refs/heads/master.
headstringThe SHA of the most recent commit on ref after the push.
beforestringThe SHA of the most recent commit on ref before the push.
コミット配列An array of commit objects describing the pushed commits. (The array includes a maximum of 20 commits. If necessary, you can use the Commits API to fetch additional commits. This limit is applied to timeline events only and isn't applied to webhook deliveries.)
commits[][sha]stringコミットのSHA。
commits[][message]stringコミットメッセージ.
commits[][author]オブジェクトThe git author of the commit.
commits[][author][name]stringThe git author's name.
commits[][author][email]stringThe git author's email address.
commits[][url]urlURL that points to the commit API resource.
commits[][distinct]booleanWhether this commit is distinct from any that have been pushed before.

ReleaseEvent

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.

The event object includes properties that are common for all events. Each event object includes a payload property and the value is unique to each event type. The payload object for this event is described below.

Event payload object

キー種類説明
actionstring実行されたアクション. Can be published.
changes[body][from]stringアクションがeditedだった場合の、以前のバージョンのbody。 changes[name][from]

WatchEvent

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.

The event object includes properties that are common for all events. Each event object includes a payload property and the value is unique to each event type. The payload object for this event is described below.

Event payload object

キー種類説明
actionstring実行されたアクション. Currently, can only be started.

担当者にお尋ねください

探しているものが見つからなかったでしょうか?

弊社にお問い合わせください