Event payload
イベントに関連付けられた Webhook がある場合、Bitbucket はイベントが発生するたびに Webhook のサーバー URL にイベント リクエストを送信します。このページでは、これらのリクエストの構造について説明します。
HTTPS エンドポイントに関連付けられた Webhook のイベント ペイロード リクエストを Bitbucket が送信する場合、URL に公的な認証局が署名した有効な SSL 証明書があることを確認してください。
The following payloads contain some of the five common entity types – User, Repository, Comment, and Pull Request – which have consistent representations in all the payloads where they appear. For example, the actor property in the repo:refs_changed payload is a representation of the event's user.
HTTP ヘッダー
すべてのイベント ペイロードには次の HTTP ヘッダーがあります。
| HTTP ヘッダー | 説明 |
|---|---|
X-Request-Id | A unique UUID for each webhook request |
X-Event-Key | The event that kicked off this webhook. For example, a repository push will have
|
X-Hub-Signature | See Webhook secrets |
リポジトリ イベント
リポジトリで発生する次のイベント用に Webhook を作成できます。
プッシュ
A user pushes one or more commits to a repository. This payload, with an event key of repo:refs_changed, provides the following fields:
| パラメーター | 説明 |
|---|---|
actor | The user who pushed the commits. |
repository | The repository with the commits. |
変更 | The details of the push. |
最終変更日
A user updates the Name of a repository. This payload, with an event key of repo:modified , provides the following fields:
| パラメーター | 説明 |
|---|---|
古い | The details of the old version of the repository. |
new | The defaults of the current version of the repository. |
actor | The user who made the update. |
フォーク
ユーザーはリポジトリをフォークします。このペイロードには repo:fork のイベント キーが含まれており、次のフィールドが提供されます。
| パラメーター | 説明 |
|---|---|
actor | The user who forks the repository. This user is also the owner of the fork. |
repository | The new repository. |
repository.origin | The original repository that was forked. |
作成したコメントのコミット
ユーザーはリポジトリのコミットにコメントを追加します。このペイロードには repo:comment:added のイベント キーが含まれており、次のフィールドが提供されます。
| パラメーター | 説明 |
|---|---|
actor | The user who comments on the commit. |
comment | The comment created. |
repository | The repository with the commit. |
commit | The hash. |
Commit edit on comment
A user edits a comment on a commit in a repository. This payload, with an event key of repo:comment:edited, provides the following fields:
| パラメーター | 説明 |
|---|---|
actor | The user who edits the commit. |
comment | The comment edited. |
previousComment | The text of the comment prior to editing. |
repository | The repository with the commit. |
commit | The hash of the commit. |
Comment deleted on commit
A user deletes a comment on a commit in a repository. This payload, with an event key of repo:comment:deleted, provides the following fields:
| パラメーター | 説明 |
|---|---|
actor | The user who deletes the commit. |
comment | The comment deleted. |
repository | The repository with the commit. |
commit | The hash of the commit. |
Mirror synchronized
A mirror has finished synchronizing this repository. This payload, with an event key of mirror:repo_synchronized, provides the following fields:
| パラメーター | 説明 |
|---|---|
mirrorServer | The mirror which synchronized the changes. This JSON object contains both the name and the id of the mirrorServer which synchronized the changes. |
syncType | The sync type the mirror used to synchronize the changes which are announced by this webhook. This value can be |
repository | The repository. |
repository.links | This JSON object contains the HTTP and SSH clone URLs of the primary server as well as the mirror that synchronized these changes. It also contains a link to view this repository in Bitbucket. |
変更 | The ref changes for this push. |
refLimitExceeded | If this value is true, the list of changes will be empty because it exceeded the limit of refs that can be included. |
プル リクエスト イベント
プル リクエストで発生する次のイベントのために webhook を作成できます。
Opened
| パラメーター | 説明 |
|---|---|
actor | The user who created the pull request. |
pullrequest | Details of the pull request created. |
最終変更日
| パラメーター | 説明 |
|---|---|
actor | The user who created the pull request. |
pullrequest | Details of the pull request created. |
previousTitle | Previous title of the pull request, may not have changed |
previousDescription | Previous description of pull request, may not have changed |
previousTarget | Previous target of the pull request, may not have changed |
Reviewers Updated
| パラメーター | 説明 |
|---|---|
actor | The user who created the pull request. |
pullrequest | Details of the pull request created. |
removedReviewers | Users that are no longer reviewers |
| addedReviewers | Users that have been added as reviewers |
承認
ユーザーによるリポジトリでのプル リクエストの承認です。このペイロードには pr:reviewer:approved のイベント キーが含まれており、次のフィールドが提供されます。
| パラメーター | 説明 |
|---|---|
actor | The user which made the approval. |
pullrequest | Details of the pull request approved. |
参加者 | Details of the PR participant status of the user making the change |
previousStatus | The state of the approval before this change |
Unapproved
ユーザーによるリポジトリでのプル リクエストからの承認の削除です。このペイロードには pr:reviewer:unapproved のイベント キーが含まれており、次のフィールドが提供されます。
| パラメーター | 説明 |
|---|---|
actor | The user which removed the approval. |
pullrequest | Details of the pull request unapproved. |
参加者 | Details of the PR participant status of the user making the change |
previousStatus | The state of the approval before this change |
Needs work
A user marks a pull request as needs work. This payload, with an event key of pr:reviewer:needs_work, provides the following fields:
| パラメーター | 説明 |
|---|---|
actor | The user which marked the PR as "Needs work". |
pullrequest | Details of the pull request marked "Needs work". |
参加者 | Details of the PR participant status of the user making the change. |
previousStatus | The state of the approval before this change. |
マージ
ユーザーによるリポジトリでのプル リクエストのマージです。このペイロードには pullrequest:fulfilled のイベント キーが含まれており、次のフィールドが提供されます。
| パラメーター | 説明 |
|---|---|
actor | The user who merged the pull request. |
pullrequest | Details of the pull request merged. |
却下
ユーザーによるリポジトリでのプル リクエストの却下です。このペイロードには pr:declined のイベント キーが含まれており、次のフィールドが提供されます。
| パラメーター | 説明 |
|---|---|
actor | The user who declined the pull request. |
pullrequest | Details of the pull request declined. |
Deleted
A user deletes a pull request for a repository. This payload, with an event key of pr:deleted, provides the following fields:
| パラメーター | 説明 |
|---|---|
actor | The user who deleted the pull request. |
pullrequest | Details of the pull request deleted. |
コメント追加時
ユーザーによるプル リクエストへのコメント追加です。このペイロードには pr:comment:added のイベント キーが含まれており、次のフィールドが提供されます。
| パラメーター | 説明 |
|---|---|
actor | The user that created the comment. |
pullRequest | The pull request comment on. |
comment | The comment created. |
commentParentId | Id of the parent comment if one exists. |
コメント編集時
このペイロードには pr:comment:edited のイベント キーが含まれており、次のフィールドが提供されます。
| パラメーター | 説明 |
|---|---|
actor | The user that edited the comment. |
pullRequest | The pull request where the comment exists. |
comment | The comment edited. |
commentParentId | Id of the parent comment if one exists. |
previousComment | Text of the previous comment. |
コメントの削除
A user deletes a comment on a pull request. This payload, with an event key of pr:comment:deleted, provides the following fields:
| パラメーター | 説明 |
|---|---|
actor | The user that deleted the comment. |
pullRequest | The pull request where the comment existed. |
comment | The comment deleted. |
commentParentId | Id of the parent comment if one exists. |