Skip to main content
我们经常发布文档更新,此页面的翻译可能仍在进行中。 有关最新信息,请访问英语文档

Webhook 事件和有效负载

了解每个 Webhook 事件发生的时间以及有效负载包含的内容。

企业帐户可用于 GitHub Enterprise Cloud 和 GitHub Enterprise Server。 有关详细信息,请参阅 GitHub Enterprise Cloud 文档中的“关于企业帐户."

在企业帐户或企业帐户中的组织上配置的 Webhook 将包括 enterprise 帐户对象。

配置 web 挂钩时,您可以使用 UI 或 API 选择哪些事件将向您发送有效负载。 仅订阅您计划处理的特定事件可限制对服务器的 HTTP 请求数。 您也可以订阅所有当前和未来的事件。 默认情况下,web 挂钩只订阅推送事件。 您可以随时更改订阅事件的列表。

您可以创建订阅此页所列事件的 web 挂钩。 每个 web 挂钩事件都包括 web 挂钩属性的说明和示例有效负载。 有关详细信息,请参阅“创建 Webhook”。

Web 挂钩有效负载对象共有属性

每个 web 挂钩事件有效负载还包含特定于事件的属性。 您可以在各个事件类型部分中找到这些独特属性。

密钥类型说明
actionstring大多数 Webhook 有效负载都包括 action 属性,其中包含触发事件的特定活动。
senderobject触发事件的用户。 此属性包含在每个 web 挂钩有效负载中。
repositoryobject发生事件的 repository。 如果事件源自存储库中的活动,则 Webhook 有效负载包含 repository 属性。
organizationobject为组织配置 Webhook 或者事件发生于组织拥有的存储库中的活动时,Webhook 负载包含 organization 对象。 installation

Webhook 事件的独特属性与你在使用 API 时在 payload 属性中发现的属性相同。 push 事件 是一个例外。 push 事件 Webhook 有效负载的独特属性和事件 API 中的 payload 属性不同。 Web 挂钩有效负载包含更详细的信息。

注意:有效负载上限为 25 MB。 如果事件生成了更大的有效负载,web 挂钩将不会触发。 例如,如果同时推送多个分支或标记,这种情况可能会发生在 create 事件中。 我们建议监控有效负载的大小以确保成功递送。

递送标头

递送到 web 挂钩已配置 URL 端点的 HTTP POST 有效负载将包含几个特殊标头:

标头说明
X-GitHub-Event触发递送的事件名称。
X-GitHub-Delivery用于标识交付的 GUID
X-Hub-Signature如果 Webhook 配置了 secret,则会发送此标头。 这是请求正文的 HMAC 十六进制摘要,是使用 SHA-1 哈希函数和作为 HMAC keysecret 生成的。 提供了 X-Hub-Signature,以便与现有集成兼容,建议你改用更安全的 X-Hub-Signature-256
X-Hub-Signature-256如果 Webhook 配置了 secret,则会发送此标头。 这是请求正文的 HMAC 十六进制摘要,是使用 SHA-256 哈希函数和作为 HMAC keysecret 生成的。

此外,请求的 User-Agent 将含有前缀 GitHub-Hookshot/

递送示例

> POST /payload HTTP/2

> Host: localhost:4567
> X-GitHub-Delivery: 72d3162e-cc78-11e3-81ab-4c9367dc0958
> X-Hub-Signature: sha1=7d38cdd689735b008b3c702edd92eea23791c5f6
> X-Hub-Signature-256: sha256=d57c68ca6f92289e6987922ff26938930f6e66a2d161ef06abdf1859230aa23c
> User-Agent: GitHub-Hookshot/044aadd
> Content-Type: application/json
> Content-Length: 6615
> X-GitHub-Event: issues

> {
>   "action": "opened",
>   "issue": {
>     "url": "https://api.github.com/repos/octocat/Hello-World/issues/1347",
>     "number": 1347,
>     ...
>   },
>   "repository" : {
>     "id": 1296269,
>     "full_name": "octocat/Hello-World",
>     "owner": {
>       "login": "octocat",
>       "id": 1,
>       ...
>     },
>     ...
>   },
>   "sender": {
>     "login": "octocat",
>     "id": 1,
>     ...
>   }
> }

branch_protection_rule

This event occurs when there is activity relating to branch protection rules. For more information, see "About protected branches." For information about the APIs to manage branch protection rules, see the GraphQL documentation or "Branch protection" in the REST API documentation.

To subscribe to this event, a GitHub App must have at least read-level access for the "Administration" repository permission

可用性

  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

操作类型

A branch protection rule was created.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: created

enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

repositoryobject必须

A repository on GitHub.

ruleobject必须

The branch protection rule. Includes a name and all the branch protection settings applied to branches that match the name. Binary settings are boolean. Multi-level configurations are one of off, non_admins, or everyone. Actor and build lists are arrays of strings.

senderobject必须

A GitHub user.

check_run

This event occurs when there is activity relating to a check run. For information about check runs, see "Getting started with the Checks API." For information about the APIs to manage check runs, see the GraphQL API documentation or "Check Runs" in the REST API documentation.

For activity relating to check suites, use the check-suite event.

To subscribe to this event, a GitHub App must have at least read-level access for the "Checks" repository permission. To receive the rerequested and requested_action event types, the app must have at least write-level access for the "Checks" permission. GitHub Apps with write-level access for the "Checks" permission are automatically subscribed to this webhook event.

Repository and organization webhooks only receive payloads for the created and completed event types in repositories.

Note: The API only looks for pushes in the repository where the check run was created. Pushes to a branch in a forked repository are not detected and return an empty pull_requests array and a null value for head_branch.

可用性

  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

操作类型

A check run was completed, and a conclusion is available.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring

: completed

check_runobject必须

A check performed on the code of a given code change

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

repositoryobject必须

A repository on GitHub.

senderobject必须

A GitHub user.

check_suite

This event occurs when there is activity relating to a check suite. For information about check suites, see "Getting started with the Checks API." For information about the APIs to manage check suites, see the GraphQL API documentation or "Check Suites" in the REST API documentation.

For activity relating to check runs, use the check_run event.

To subscribe to this event, a GitHub App must have at least read-level access for the "Checks" permission. To receive the requested and rerequested event types, the app must have at lease write-level access for the "Checks" permission. GitHub Apps with write-level access for the "Checks" permission are automatically subscribed to this webhook event.

Repository and organization webhooks only receive payloads for the completed event types in repositories.

Note: The API only looks for pushes in the repository where the check suite was created. Pushes to a branch in a forked repository are not detected and return an empty pull_requests array and a null value for head_branch.

可用性

  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

操作类型

All check runs in a check suite have completed, and a conclusion is available.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: completed

actions_metaobject or null
check_suiteobject必须
enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

repositoryobject必须

A repository on GitHub.

senderobject必须

A GitHub user.

code_scanning_alert

This event occurs when there is activity relating to code scanning alerts in a repository. For more information, see "About code scanning" and "About code scanning alerts." For information about the API to manage code scanning, see "Code scanning" in the REST API documentation.

To subscribe to this event, a GitHub App must have at least read-level access for the "Code scanning alerts" repository permission.

可用性

  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

操作类型

A previously created code scanning alert appeared in another branch. This can happen when a branch is merged into or created from a branch with a pre-existing code scanning alert.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: appeared_in_branch

alertobject必须

The code scanning alert involved in the event.

commit_oidstring必须

The commit SHA of the code scanning alert. When the action is reopened_by_user or closed_by_user, the event was triggered by the sender and this value will be empty.

enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

refstring必须

The Git reference of the code scanning alert. When the action is reopened_by_user or closed_by_user, the event was triggered by the sender and this value will be empty.

repositoryobject必须

A repository on GitHub.

senderobject必须

A GitHub user.

commit_comment

This event occurs when there is activity relating to commit comments. For more information about commit comments, see "Commenting on a pull request." For information about the APIs to manage commit comments, see the GraphQL API documentation or "Commit comments" in the REST API documentation.

For activity relating to comments on pull request reviews, use the pull_request_review_comment event. For activity relating to issue comments, use the issue_comment event. For activity relating to discussion comments, use the discussion_comment event.

To subscribe to this event, a GitHub App must have at least read-level access for the "Contents" repository permission.

可用性

  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

Someone commented on a commit.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

The action performed. Can be created.

: created

commentobject必须

The commit comment resource.

enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

repositoryobject必须

A repository on GitHub.

senderobject必须

A GitHub user.

create

This event occurs when a Git branch or tag is created.

To subscribe to this event, a GitHub App must have at least read-level access for the "Contents" repository permission.

Note: This event will not occur when more than three tags are created at once.

可用性

  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
descriptionstring or null必须

The repository's current description.

enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

master_branchstring必须

The name of the repository's default branch (usually main).

organizationobject

A GitHub organization.

pusher_typestring必须

The pusher type for the event. Can be either user or a deploy key.

refstring必须

The git ref resource.

ref_typestring必须

The type of Git ref object created in the repository.

可以是以下选项之一: tag, branch

repositoryobject必须

A repository on GitHub.

senderobject必须

A GitHub user.

delete

This event occurs when a Git branch or tag is deleted.

To subscribe to this event, a GitHub App must have at least read-level access for the "Contents" repository permission.

Note: This event will not occur when more than three tags are deleted at once.

可用性

  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

pusher_typestring必须

The pusher type for the event. Can be either user or a deploy key.

refstring必须

The git ref resource.

ref_typestring必须

The type of Git ref object deleted in the repository.

可以是以下选项之一: tag, branch

repositoryobject必须

A repository on GitHub.

senderobject必须

A GitHub user.

dependabot_alert

This event occurs when there is activity relating to Dependabot alerts.

For more information about Dependabot alerts, see "About Dependabot alerts." For information about the API to manage Dependabot alerts, see "Dependabot alerts" in the REST API documentation.

To subscribe to this event, a GitHub App must have at least read-level access for the "Dependabot alerts" repository permission.

Note: Webhook events for Dependabot alerts are currently in beta and subject to change.

可用性

  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

操作类型

A manifest file change introduced a vulnerable dependency, or a GitHub Security Advisory was published and an existing dependency was found to be vulnerable.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: created

alertobject必须

A Dependabot alert.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

enterpriseobject

An enterprise on GitHub.

repositoryobject必须

A repository on GitHub.

senderobject必须

A GitHub user.

deploy_key

This event occurs when there is activity relating to deploy keys. For more information, see "Managing deploy keys." For information about the APIs to manage deploy keys, see the GraphQL API documentation or "Deploy keys" in the REST API documentation.

To subscribe to this event, a GitHub App must have at least read-level access for the "Deployments" repository permission.

可用性

  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

操作类型

A deploy key was created.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: created

enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

keyobject必须

The deploy key resource.

organizationobject

A GitHub organization.

repositoryobject必须

A repository on GitHub.

senderobject必须

A GitHub user.

deployment

This event occurs when there is activity relating to deployments. For more information, see "About deployments." For information about the APIs to manage deployments, see the GraphQL API documentation or "Deployments" in the REST API documentation.

For activity relating to deployment status, use the deployment_status event.

To subscribe to this event, a GitHub App must have at least read-level access for the "Deployments" repository permission.

可用性

  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

A deployment was created.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: created

deploymentobject必须
enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

repositoryobject必须

A repository on GitHub.

senderobject必须

A GitHub user.

workflowobject or null必须
workflow_runobject or null必须

deployment_status

This event occurs when there is activity relating to deployment statuses. For more information, see "About deployments." For information about the APIs to manage deployments, see the GraphQL API documentation or "Deployments" in the REST API documentation.

For activity relating to deployment creation, use the deployment event.

To subscribe to this event, a GitHub App must have at least read-level access for the "Deployments" repository permission.

可用性

  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

A new deployment status was created.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: created

check_runobject or null
deploymentobject必须
deployment_statusobject必须
enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

repositoryobject必须

A repository on GitHub.

senderobject必须

A GitHub user.

workflowobject or null
workflow_runobject or null

discussion

This event occurs when there is activity relating to a discussion. For more information about discussions, see "GitHub Discussions." For information about the API to manage discussions, see the GraphQL documentation.

For activity relating to a comment on a discussion, use the discussion_comment event.

To subscribe to this event, a GitHub App must have at least read-level access for the "Discussions" repository permission.

Note: Webhook events for GitHub Discussions are currently in beta and subject to change.

可用性

  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

操作类型

A comment on the discussion was marked as the answer.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: answered

answerobject必须
discussion必须
enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

repositoryobject必须

A repository on GitHub.

senderobject必须

A GitHub user.

discussion_comment

This event occurs when there is activity relating to a comment on a discussion. For more information about discussions, see "GitHub Discussions." For information about the API to manage discussions, see the GraphQL documentation.

For activity relating to a discussion as opposed to comments on a discussion, use the discussion event.

To subscribe to this event, a GitHub App must have at least read-level access for the "Discussions" repository permission.

Note: Webhook events for GitHub Discussions are currently in beta and subject to change.

可用性

  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

操作类型

A comment on a discussion was created.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: created

commentobject必须
discussionobject必须
enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

repositoryobject必须

A repository on GitHub.

senderobject必须

A GitHub user.

fork

This event occurs when someone forks a repository. For more information, see "Fork a repo." For information about the API to manage forks, see "Forks" in the REST API documentation.

To subscribe to this event, a GitHub App must have at least read-level access for the "Contents" repository permission.

可用性

  • 企业
  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
enterpriseobject

An enterprise on GitHub.

forkee必须

The created repository resource.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

repositoryobject必须

A repository on GitHub.

senderobject必须

A GitHub user.

github_app_authorization

This event occurs when a user revokes their authorization of a GitHub App. For more information, see "About apps." For information about the API to manage GitHub Apps, see the GraphQL API documentation or "Apps" in the REST API documentation.

A GitHub App receives this webhook by default and cannot unsubscribe from this event.

Anyone can revoke their authorization of a GitHub App from their GitHub account settings page. Revoking the authorization of a GitHub App does not uninstall the GitHub App. You should program your GitHub App so that when it receives this webhook, it stops calling the API on behalf of the person who revoked the token. If your GitHub App continues to use a revoked access token, it will receive the 401 Bad Credentials error. For details about user-to-server requests, which require GitHub App authorization, see "Identifying and authorizing users for GitHub Apps."

可用性

  • GitHub 应用

Web 挂钩有效负载对象

Someone revoked their authorization of a GitHub App.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: revoked

enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

repositoryobject

A repository on GitHub.

senderobject必须

A GitHub user.

gollum

This event occurs when someone creates or updates a wiki page. For more information, see "About wikis."

To subscribe to this event, a GitHub App must have at least read-level access for the "Contents" repository permission.

可用性

  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

pagesarray of objects必须

The pages that were updated.

repositoryobject必须

A repository on GitHub.

senderobject必须

A GitHub user.

installation

This event occurs when there is activity relating to a GitHub App installation. All GitHub Apps receive this event by default. You cannot manually subscribe to this event.

For more information about GitHub Apps, see "About apps." For information about the APIs to manage GitHub Apps, see the GraphQL API documentation or "Apps" in the REST API documentation.

可用性

  • GitHub 应用

Web 挂钩有效负载对象

操作类型

Someone installed a GitHub App on a user or organization account.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: created

enterpriseobject

An enterprise on GitHub.

installationobject必须

Installation

organizationobject

A GitHub organization.

repositoriesarray of objects

An array of repository objects that the installation can access.

repositoryobject

A repository on GitHub.

requesterobject or null
senderobject必须

A GitHub user.

installation_repositories

This event occurs when there is activity relating to which repositories a GitHub App installation can access. All GitHub Apps receive this event by default. You cannot manually subscribe to this event.

For more information about GitHub Apps, see "About apps." For information about the APIs to manage GitHub Apps, see the GraphQL API documentation or "Apps" in the REST API documentation.

可用性

  • GitHub 应用

Web 挂钩有效负载对象

操作类型

A GitHub App installation was granted access to one or more repositories.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: added

enterpriseobject

An enterprise on GitHub.

installationobject必须

Installation

organizationobject

A GitHub organization.

repositories_addedarray of objects必须

An array of repository objects, which were added to the installation.

repositories_removedarray of objects必须

An array of repository objects, which were removed from the installation.

repositoryobject

A repository on GitHub.

repository_selectionstring必须

Describe whether all repositories have been selected or there's a selection involved

可以是以下选项之一: all, selected

requesterobject or null必须
senderobject必须

A GitHub user.

installation_target

This event occurs when there is activity relating to the user or organization account that a GitHub App is installed on. For more information, see "About apps." For information about the APIs to manage GitHub Apps, see the GraphQL API documentation or "Apps" in the REST API documentation.

可用性

  • GitHub 应用

Web 挂钩有效负载对象

Somebody renamed the user or organization account that a GitHub App is installed on.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
accountobject必须
actionstring必须
changesobject必须
enterpriseobject

An enterprise on GitHub.

installationobject必须

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

repositoryobject

A repository on GitHub.

senderobject

A GitHub user.

target_typestring必须

issue_comment

This event occurs when there is activity relating to a comment on an issue or pull request. For more information about issues and pull requests, see "About issues" and "About pull requests." For information about the APIs to manage issue comments, see the GraphQL documentation or "Issue comments" in the REST API documentation.

For activity relating to an issue as opposed to comments on an issue, use the issue event. For activity related to pull request reviews or pull request review comments, use the pull_request_review or pull_request_review_comment events. For more information about the different types of pull request comments, see "Working with comments."

To subscribe to this event, a GitHub App must have at least read-level access for the "Issues" or "Pull requests" repository permissions.

可用性

  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

操作类型

A comment on an issue or pull request was created.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: created

commentobject必须

The comment itself.

enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

issue必须

The issue the comment belongs to.

organizationobject

A GitHub organization.

repositoryobject必须

A repository on GitHub.

senderobject必须

A GitHub user.

issues

This event occurs when there is activity relating to an issue. For more information about issues, see "About issues." For information about the APIs to manage issues, see the GraphQL documentation or "Issues" in the REST API documentation.

For activity relating to a comment on an issue, use the issue_comment event.

To subscribe to this event, a GitHub App must have at least read-level access for the "Issues" repository permission.

可用性

  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

操作类型

An issue was assigned to a user.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

The action that was performed.

: assigned

assigneeobject or null
enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

issueobject必须

The issue itself.

organizationobject

A GitHub organization.

repositoryobject必须

A repository on GitHub.

senderobject必须

A GitHub user.

label

This event occurs when there is activity relating to labels. For more information, see "Managing labels." For information about the APIs to manage labels, see the GraphQL documentation or "Labels" in the REST API documentation.

If you want to receive an event when a label is added to or removed from an issue, pull request, or discussion, use the labeled or unlabeled action type for the issues, pull_request, or discussion events instead.

To subscribe to this event, a GitHub App must have at least read-level access for the "Metadata" repository permission.

可用性

  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

操作类型

A label was created.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: created

enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

labelobject必须
organizationobject

A GitHub organization.

repositoryobject必须

A repository on GitHub.

senderobject

A GitHub user.

marketplace_purchase

This event occurs when there is activity relating to a GitHub Marketplace purchase. For more information, see "GitHub Marketplace." For information about the APIs to manage GitHub Marketplace listings, see the GraphQL documentation or "GitHub Marketplace" in the REST API documentation.

可用性

  • GitHub 市场

Web 挂钩有效负载对象

操作类型

Someone cancelled a GitHub Marketplace plan, and the last billing cycle has ended. The change will take effect on the account immediately.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: cancelled

effective_datestring必须
enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

marketplace_purchase必须
organizationobject

A GitHub organization.

previous_marketplace_purchaseobject
repositoryobject

A repository on GitHub.

senderobject必须

A GitHub user.

member

This event occurs when there is activity relating to collaborators in a repository. For more information, see "Adding outside collaborators to repositories in your organization." For more information about the API to manage repository collaborators, see the GraphQL API documentation or "Collaborators" in the REST API documentation.

To subscribe to this event, a GitHub App must have at least read-level access for the "Members" organization permission.

可用性

  • 企业
  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

操作类型

A GitHub user accepted an invitation to a repository.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: added

changesobject
enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

memberobject or null必须
organizationobject

A GitHub organization.

repositoryobject必须

A repository on GitHub.

senderobject必须

A GitHub user.

membership

This event occurs when there is activity relating to team membership. For more information, see "About teams." For more information about the APIs to manage team memberships, see the GraphQL API documentation or "Team members" in the REST API documentation.

To subscribe to this event, a GitHub App must have at least read-level access for the "Members" organization permission.

可用性

  • 组织
  • 企业
  • GitHub 应用

Web 挂钩有效负载对象

操作类型

An organization member was added to a team.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: added

enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

memberobject or null必须
organizationobject必须

A GitHub organization.

repositoryobject

A repository on GitHub.

scopestring必须

The scope of the membership. Currently, can only be team.

: team

senderobject or null必须
teamobject必须

Groups of organization members that gives permissions on specified repositories.

merge_group

This event occurs when there is activity relating to a merge group in a merge queue. For more information, see "Managing a merge queue."

To subscribe to this event, a GitHub App must have at least read-level access for the "Merge queues" repository permission.

Note: The pull request merge queue feature is currently in limited private beta and subject to change.

可用性

  • GitHub 应用

Web 挂钩有效负载对象

Status checks were requested for a merge group. This happens when a merge group is created or added to by the merge queue because a pull request was queued.

When you receive this event, you should perform checks on the head SHA and report status back using check runs or commit statuses.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须
installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

merge_groupobject必须
organizationobject

A GitHub organization.

repositoryobject

A repository on GitHub.

senderobject

A GitHub user.

meta

This event occurs when there is activity relating to a webhook itself.

To subscribe to this event, a GitHub App must have at least read-level access for the "Meta" app permission.

可用性

  • GitHub 市场
  • 企业
  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

The webhook was deleted.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: deleted

enterpriseobject

An enterprise on GitHub.

hookobject必须

The modified webhook. This will contain different keys based on the type of webhook it is: repository, organization, business, app, or GitHub Marketplace.

hook_idinteger必须

The id of the modified webhook.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

repositoryobject

A repository on GitHub.

senderobject

A GitHub user.

milestone

This event occurs when there is activity relating to milestones. For more information, see "About milestones." For information about the APIs to manage milestones, see the GraphQL documentation or "Milestones" in the REST API documentation.

If you want to receive an event when an issue or pull request is added to or removed from a milestone, use the milestoned or demilestoned action type for the issues or pull_request events instead.

To subscribe to this event, a GitHub App must have at least read-level access for the "Issues" or "Pull requests" repository permissions.

可用性

  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

操作类型

A milestone was closed.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: closed

enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

milestoneobject必须

A collection of related issues and pull requests.

organizationobject

A GitHub organization.

repositoryobject必须

A repository on GitHub.

senderobject必须

A GitHub user.

org_block

This event occurs when organization owners or moderators block or unblock a non-member from collaborating on the organization's repositories. For more information, see "Blocking a user from your organization." For information about the APIs to manage blocked users, see the GraphQL documentation or "Blocking users" in the REST API documentation.

If you want to receive an event when members are added or removed from an organization, use the organization event instead.

To subscribe to this event, a GitHub App must have at least read-level access for the "Administration" organization permission.

可用性

  • 组织
  • 企业
  • GitHub 应用

Web 挂钩有效负载对象

操作类型

A user was blocked from the organization.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: blocked

blocked_userobject or null必须
enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject必须

A GitHub organization.

repositoryobject

A repository on GitHub.

senderobject必须

A GitHub user.

organization

This event occurs when there is activity relating to an organization and its members. For more information, see "About organizations." For information about the APIs to manage organizations, see the GraphQL documentation or "Organizations" in the REST API documentation.

If you want to receive an event when a non-member is blocked or unblocked from an organization, use the org_block event instead.

To subscribe to this event, a GitHub App must have at least read-level access for the "Members" organization permission.

可用性

  • 组织
  • 企业
  • GitHub 应用

Web 挂钩有效负载对象

操作类型

An organization was deleted.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: deleted

enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

membershipobject

The membership between the user and the organization. Not present when the action is member_invited.

organizationobject必须

A GitHub organization.

repositoryobject

A repository on GitHub.

senderobject必须

A GitHub user.

package

This event occurs when there is activity relating to GitHub Packages. For more information, see "Introduction to GitHub Packages." For information about the APIs to manage GitHub Packages, see the GraphQL API documentation or "Packages" in the REST API documentation.

To install this event on a GitHub App, the app must have at least read-level access for the "Packages" repository permission.

可用性

  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

操作类型

A package was published to a registry.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: published

enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

packageobject必须

Information about the package.

repositoryobject

A repository on GitHub.

senderobject必须

A GitHub user.

page_build

This event occurs when there is an attempted build of a GitHub Pages site. This event occurs regardless of whether the build is successful. For more information, see "Configuring a publishing source for your GitHub Pages site." For information about the API to manage GitHub Pages, see "Pages" in the REST API documentation.

To subscribe to this event, a GitHub App must have at least read-level access for the "Pages" repository permission.

可用性

  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
buildobject必须
enterpriseobject

An enterprise on GitHub.

idinteger必须
installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

repositoryobject必须

A repository on GitHub.

senderobject必须

A GitHub user.

ping

This event occurs when you create a new webhook. The ping event is a confirmation from GitHub that you configured the webhook correctly.

可用性

  • 存储库
  • 组织
  • GitHub 应用
  • 企业
  • GitHub 市场

Web 挂钩有效负载对象

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
hookobject

The webhook that is being pinged

hook_idinteger

The ID of the webhook that triggered the ping.

organizationobject

A GitHub organization.

repositoryobject

A repository on GitHub.

senderobject

A GitHub user.

zenstring

Random string of GitHub zen.

project_card

This event occurs when there is activity relating to a card on a classic project. For more information, see "About projects (classic)." For information about the API to manage classic projects, see the GraphQL API documentation or "Projects (classic)" in the REST API documentation.

For activity relating to a project or a column on a project, use the project and project_column event. For activity relating to Projects instead of Projects (classic), use the projects_v2 event instead.

To subscribe to this event, a GitHub App must have at least read-level access for the "Projects" repository or organization permission.

可用性

  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

操作类型

A note in a classic project was converted to an issue.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: converted

changesobject必须
enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

project_cardobject必须
repositoryobject

A repository on GitHub.

senderobject必须

A GitHub user.

project

This event occurs when there is activity relating to a classic project. For more information, see "About projects (classic)." For information about the API to manage classic projects, see the GraphQL API documentation or "Projects (classic)" in the REST API documentation.

For activity relating to a card or column on a project, use the project_card and project_column event. For activity relating to Projects instead of Projects (classic), use the projects_v2 event instead.

To subscribe to this event, a GitHub App must have at least read-level access for the "Projects" repository or organization permission.

可用性

  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

操作类型

A classic project was closed.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: closed

enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

projectobject必须
repositoryobject

A repository on GitHub.

senderobject必须

A GitHub user.

project_column

This event occurs when there is activity relating to a column on a classic project. For more information, see "About projects (classic)." For information about the API to manage classic projects, see the GraphQL API documentation or "Projects (classic)" in the REST API documentation.

For activity relating to a project or a card on a project, use the project and project_card event. For activity relating to Projects instead of Projects (classic), use the projects_v2 event instead.

To subscribe to this event, a GitHub App must have at least read-level access for the "Projects" repository or organization permission.

可用性

  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

操作类型

A column was added to a classic project.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: created

enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

project_columnobject必须
repositoryobject

A repository on GitHub.

senderobject

A GitHub user.

projects_v2

This event occurs when there is activity relating to an organization-level project. For more information, see "About Projects." For information about the Projects API, see the GraphQL documentation.

For activity relating to a item on a project, use the projects_v2_item event. For activity relating to Projects (classic), use the project, project_card, and project_column` events instead.

To subscribe to this event, a GitHub App must have at least read-level access for the "Projects" organization permission.

Note: Webhook events for projects are currently in beta and subject to change. To share feedback about projects webhooks with GitHub, see the Projects webhook feedback discussion.

可用性

  • 组织

Web 挂钩有效负载对象

操作类型

A project in the organization was closed.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: closed

organizationobject必须

A GitHub organization.

projects_v2object必须

A projects v2 project

senderobject必须

A GitHub user.

projects_v2_item

This event occurs when there is activity relating to an item on an organization-level project. For more information, see "About Projects." For information about the Projects API, see the GraphQL documentation.

For activity relating to a project (instead of an item on a project), use the projects_v2 event. For activity relating to Projects (classic), use the project, project_card, and project_column events instead.

To subscribe to this event, a GitHub App must have at least read-level access for the "Projects" organization permission.

Note: Webhook events for projects are currently in beta and subject to change. To share feedback about projects webhooks with GitHub, see the Projects webhook feedback discussion.

可用性

  • 组织

Web 挂钩有效负载对象

操作类型

An item on an organization project was archived. For more information, see "Archiving items from your project."

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: archived

changesobject必须
installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject必须

A GitHub organization.

projects_v2_itemobject必须

An item belonging to a project

senderobject必须

A GitHub user.

public

This event occurs when repository visibility changes from private to public. For more information, see "Setting repository visibility."

To subscribe to this event, a GitHub App must have at least read-level access for the "Metadata" repository permission.

可用性

  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

repositoryobject必须

A repository on GitHub.

senderobject必须

A GitHub user.

pull_request

This event occurs when there is activity on a pull request. For more information, see "About pull requests." For information about the APIs to manage pull requests, see the GraphQL API documentation or "Pulls" in the REST API documentation.

For activity related to pull request reviews, pull request review comments, pull request comments, or pull request review threads, use the pull_request_review, pull_request_review_comment, issue_comment, or pull_request_review_thread events instead.

To subscribe to this event, a GitHub App must have at least read-level access for the "Pull requests" repository permission.

可用性

  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

操作类型

A pull request was assigned to a user.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: assigned

assigneeobject or null必须
enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

numberinteger必须

The pull request number.

organizationobject

A GitHub organization.

pull_requestobject必须
repositoryobject必须

A repository on GitHub.

senderobject必须

A GitHub user.

pull_request_review_comment

This event occurs when there is activity relating to a pull request review comment. A pull request review comment is a comment on a pull request's diff. For more information, see "Commenting on a pull request." For information about the APIs to manage pull request review comments, see the GraphQL API documentation or "Pull request review comments" in the REST API documentation.

For activity related to pull request reviews, pull request comments, or pull request review threads, use the pull_request_review, issue_comment, or pull_request_review_thread events instead.

To subscribe to this event, a GitHub App must have at least read-level access for the "Pull requests" repository permission.

可用性

  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

操作类型

A comment on a pull request diff was created.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: created

commentobject必须

The comment itself.

enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

pull_requestobject必须
repositoryobject必须

A repository on GitHub.

senderobject必须

A GitHub user.

pull_request_review

This event occurs when there is activity relating to a pull request review. A pull request review is a group of pull request review comments in addition to a body comment and a state. For more information, see "About pull request reviews." For information about the APIs to manage pull request reviews, see the GraphQL API documentation or "Pull request reviews" in the REST API documentation.

For activity related to pull request review comments, pull request comments, or pull request review threads, use the pull_request_review_comment, issue_comment, or pull_request_review_thread events instead.

To subscribe to this event, a GitHub App must have at least read-level access for the "Pull requests" repository permission.

可用性

  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

操作类型

A review on a pull request was dismissed.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: dismissed

enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

pull_requestobject必须
repositoryobject必须

A repository on GitHub.

reviewobject必须

The review that was affected.

senderobject必须

A GitHub user.

pull_request_review_thread

This event occurs when there is activity relating to a comment thread on a pull request. For more information, see "About pull request reviews." For information about the APIs to manage pull request review comment threads, see the GraphQL API documentation or "Pull request reviews" in the REST API documentation.

For activity related to pull request review comments, pull request comments, or pull request reviews, use the pull_request_review_comment, issue_comment, or pull_request_review events instead.

To subscribe to this event, a GitHub App must have at least read-level access for the "Pull requests" repository permission.

可用性

  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

操作类型

A comment thread on a pull request was marked as resolved.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: resolved

enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

pull_requestobject必须
repositoryobject必须

A repository on GitHub.

senderobject

A GitHub user.

threadobject必须

push

This event occurs when a commit or tag is pushed.

To subscribe to this event, a GitHub App must have at least read-level access for the "Contents" repository permission.

Note: An event will not be created when more than three tags are pushed at once.

可用性

  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
afterstring必须

The SHA of the most recent commit on ref after the push.

base_refstring or null必须
beforestring必须

The SHA of the most recent commit on ref before the push.

commitsarray of objects必须

An array of commit objects describing the pushed commits. (Pushed commits are all commits that are included in the compare between the before commit and the after commit.) 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.

comparestring必须

URL that shows the changes in this ref update, from the before commit to the after commit. For a newly created ref that is directly based on the default branch, this is the comparison between the head of the default branch and the after commit. Otherwise, this shows all commits until the after commit.

createdboolean必须

Whether this push created the ref.

deletedboolean必须

Whether this push deleted the ref.

enterpriseobject

An enterprise on GitHub.

forcedboolean必须

Whether this push was a force push of the ref.

head_commitobject or null必须
installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

pusherobject必须

Metaproperties for Git author/committer information.

refstring必须

The full git ref that was pushed. Example: refs/heads/main or refs/tags/v3.14.1.

repositoryobject必须

A git repository

senderobject

A GitHub user.

registry_package

This event occurs when there is activity relating to GitHub Packages. For more information, see "Introduction to GitHub Packages." For information about the APIs to manage GitHub Packages, see the GraphQL API documentation or "Packages" in the REST API documentation.

To install this event on a GitHub App, the app must have at least read-level access for the "Packages" repository permission.

Note: GitHub recommends that you use the newer package event instead.

可用性

  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

操作类型

A package was published to a registry.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: published

enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

registry_packageobject必须
repositoryobject

A repository on GitHub.

senderobject必须

A GitHub user.

release

This event occurs when there is activity relating to releases. For more information, see "About releases." For information about the APIs to manage releases, see the GraphQL API documentation or "Releases" in the REST API documentation.

To subscribe to this event, a GitHub App must have at least read-level access for the "Contents" repository permission.

可用性

  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

操作类型

A draft was saved, or a release or pre-release was published without previously being saved as a draft.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: created

enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

releaseobject必须

The release object.

repositoryobject必须

A repository on GitHub.

senderobject必须

A GitHub user.

repository

This event occurs when there is activity relating to repositories. For more information, see "About repositories." For information about the APIs to manage repositories, see the GraphQL documentation or "Repositories" in the REST API documentation.

To subscribe to this event, a GitHub App must have at least read-level access for the "Metadata" repository permission.

可用性

  • 企业
  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

操作类型

A repository was archived.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: archived

enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

repositoryobject必须

A repository on GitHub.

senderobject必须

A GitHub user.

repository_dispatch

This event occurs when a GitHub App sends a POST request to /repos/{owner}/{repo}/dispatches. For more information, see the REST API documentation for creating a repository dispatch event.

To subscribe to this event, a GitHub App must have at least read-level access for the "Contents" repository permission.

可用性

  • GitHub 应用

Web 挂钩有效负载对象

The event_type that was specified in the POST /repos/{owner}/{repo}/dispatches request body.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须
branchstring必须
client_payloadobject or null必须
enterpriseobject

An enterprise on GitHub.

installationobject必须

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

repositoryobject必须

A repository on GitHub.

senderobject必须

A GitHub user.

repository_import

This event occurs when a repository is imported to GitHub Enterprise Cloud. For more information, see "Importing a repository with GitHub Importer." For more information about the API to manage imports, see the REST API documentation.

可用性

  • 存储库
  • 组织

Web 挂钩有效负载对象

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

repositoryobject必须

A repository on GitHub.

senderobject必须

A GitHub user.

statusstring必须

可以是以下选项之一: success, cancelled, failure

repository_vulnerability_alert

This event occurs when there is activity relating to a security vulnerability alert in a repository.

Note: This event is deprecated. Use the dependabot_alert event instead.

可用性

  • 存储库
  • 组织

Web 挂钩有效负载对象

操作类型

A repository vulnerability alert was created.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: create

alert必须
enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

repositoryobject必须

A repository on GitHub.

senderobject必须

A GitHub user.

secret_scanning_alert

This event occurs when there is activity relating to a secret scanning alert. For more information about secret scanning, see "About secret scanning." For information about the API to manage secret scanning alerts, see "Secret scanning" in the REST API documentation.

For activity relating to secret scanning alert locations, use the secret_scanning_alert_location event.

To subscribe to this event, a GitHub App must have at least read-level access for the "Secret scanning alerts" repository permission.

可用性

  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

操作类型

A secret scanning alert was created.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: created

alertobject必须
enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

repositoryobject必须

A repository on GitHub.

senderobject

A GitHub user.

secret_scanning_alert_location

This event occurs when there is activity relating to the locations of a secret in a secret scanning alert.

For more information about secret scanning, see "About secret scanning." For information about the API to manage secret scanning alerts, see "Secret scanning" in the REST API documentation.

For activity relating to secret scanning alerts, use the secret_scanning_alert event.

To subscribe to this event, a GitHub App must have at least read-level access for the "Secret scanning alerts" repository permission.

可用性

  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

A new instance of a previously detected secret was detected in a repository, and the location of the secret was added to the existing alert.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring

: created

alertobject必须
installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

locationobject必须
organizationobject

A GitHub organization.

repositoryobject必须

A repository on GitHub.

senderobject必须

A GitHub user.

security_advisory

This event occurs when there is activity relating to a security advisory that was reviewed by GitHub. A GitHub-reviewed security advisory provides information about security-related vulnerabilities in software on GitHub. For more information about security advisories, see "About GitHub Security Advisories for repositories." For information about the API to manage security advisories, see the GraphQL documentation.

GitHub Dependabot alerts are also powered by the security advisory dataset. For more information, see "About Dependabot alerts."

可用性

  • GitHub 应用

Web 挂钩有效负载对象

操作类型

A security advisory was published to the GitHub community.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: published

enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

repositoryobject

A repository on GitHub.

security_advisoryobject必须

The details of the security advisory, including summary, description, and severity.

senderobject

A GitHub user.

security_and_analysis

This event occurs when code security and analysis features are enabled or disabled for a repository. For more information, see "GitHub security features."

To subscribe to this event, a GitHub App must have at least read-level access for the "Administration" repository permission.

可用性

  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
changesobject必须
enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

repositoryobject必须

Full Repository

senderobject

A GitHub user.

sponsorship

This event occurs when there is activity relating to a sponsorship listing. For more information, see "About GitHub Sponsors." For information about the API to manage sponsors, see the GraphQL documentation.

You can only create a sponsorship webhook on GitHub.com. For more information, see "Configuring webhooks for events in your sponsored account."

可用性

  • 赞助帐户

Web 挂钩有效负载对象

操作类型

A sponsorship was cancelled and the last billing cycle has ended.

This event is only sent when a recurring (monthly) sponsorship is cancelled; it is not sent for one-time sponsorships.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: cancelled

enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

repositoryobject

A repository on GitHub.

senderobject必须

A GitHub user.

sponsorshipobject必须

star

This event occurs when there is activity relating to repository stars. For more information about stars, see "Saving repositories with stars." For information about the APIs to manage stars, see the GraphQL documentation or "Starring" in the REST API documentation.

To subscribe to this event, a GitHub App must have at least read-level access for the "Metadata" repository permission.

可用性

  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

操作类型

Someone starred a repository.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: created

enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

repositoryobject必须

A repository on GitHub.

senderobject必须

A GitHub user.

starred_atstring or null必须

The time the star was created. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ. Will be null for the deleted action.

status

This event occurs when the status of a Git commit changes. For example, commits can be marked as error, failure, pending, or success. For more information, see "About status checks." For information about the APIs to manage commit statuses, see the GraphQL documentation or "Statuses" in the REST API documentation.

To subscribe to this event, a GitHub App must have at least read-level access for the "Commit statuses" repository permission.

可用性

  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
avatar_urlstring or null
branchesarray of objects必须

An array of branch objects containing the status' SHA. Each branch contains the given SHA, but the SHA may or may not be the head of the branch. The array includes a maximum of 10 branches.

commitobject必须
contextstring必须
created_atstring必须
descriptionstring or null必须

The optional human-readable description added to the status.

enterpriseobject

An enterprise on GitHub.

idinteger必须

The unique identifier of the status.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

namestring必须
organizationobject

A GitHub organization.

repositoryobject必须

A repository on GitHub.

senderobject必须

A GitHub user.

shastring必须

The Commit SHA.

statestring必须

The new state. Can be pending, success, failure, or error.

可以是以下选项之一: pending, success, failure, error

target_urlstring or null必须

The optional link added to the status.

updated_atstring必须

team_add

This event occurs when a team is added to a repository. For more information, see "Managing teams and people with access to your repository."

For activity relating to teams, see the teams event.

To subscribe to this event, a GitHub App must have at least read-level access for the "Members" organization permission.

可用性

  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

repositoryobject必须

A repository on GitHub.

senderobject必须

A GitHub user.

teamobject必须

Groups of organization members that gives permissions on specified repositories.

team

This event occurs when there is activity relating to teams in an organization. For more information, see "About teams."

To subscribe to this event, a GitHub App must have at least read-level access for the "Members" organization permission.

可用性

  • 组织
  • 企业
  • GitHub 应用

Web 挂钩有效负载对象

操作类型

A team was granted access to a repository.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: added_to_repository

enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject必须

A GitHub organization.

repositoryobject

A git repository

senderobject

A GitHub user.

teamobject必须

Groups of organization members that gives permissions on specified repositories.

watch

This event occurs when there is activity relating to watching, or subscribing to, a repository. For more information about watching, see "Managing your subscriptions." For information about the APIs to manage watching, see "Watching" in the REST API documentation.

To subscribe to this event, a GitHub App must have at least read-level access for the "Metadata" repository permission.

可用性

  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

Someone started watching the repository.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: started

enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

repositoryobject必须

A repository on GitHub.

senderobject必须

A GitHub user.

workflow_dispatch

This event occurs when a GitHub Actions workflow is manually triggered. For more information, see "Manually running a workflow."

For activity relating to workflow runs, use the workflow_run event.

To subscribe to this event, a GitHub App must have at least read-level access for the "Contents" repository permission.

可用性

  • GitHub 应用

Web 挂钩有效负载对象

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
enterpriseobject

An enterprise on GitHub.

inputsobject or null必须
installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

refstring必须
repositoryobject必须

A repository on GitHub.

senderobject必须

A GitHub user.

workflowstring必须

workflow_job

This event occurs when there is activity relating to a job in a GitHub Actions workflow. For more information, see "Using jobs in a workflow." For information about the API to manage workflow jobs, see "Workflow jobs" in the REST API documentation.

For activity relating to a workflow run instead of a job in a workflow run, use the workflow_run event.

To subscribe to this event, a GitHub App must have at least read-level access for the "Actions" repository permission.

可用性

  • 企业
  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

操作类型

A job in a workflow run finished. This event occurs when a job in a workflow is completed, regardless of whether the job was successful or unsuccessful.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: completed

enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

repositoryobject必须

A repository on GitHub.

senderobject必须

A GitHub user.

workflow_job必须
deploymentobject

A request for a specific ref(branch,sha,tag) to be deployed

workflow_run

This event occurs when there is activity relating to a run of a GitHub Actions workflow. For more information, see "About workflows." For information about the APIs to manage workflow runs, see the GraphQL documentation or "Workflow runs" in the REST API documentation.

For activity relating to a job in a workflow run, use the workflow_job event.

To subscribe to this event, a GitHub App must have at least read-level access for the "Actions" repository permission.

可用性

  • 企业
  • 存储库
  • 组织
  • GitHub 应用

Web 挂钩有效负载对象

操作类型

A workflow run finished. This event occurs when a workflow run is completed, regardless of whether the workflow was successful or unsuccessful.

标头
名称, 类型, 说明
正文参数
名称, 类型, 说明
actionstring必须

: completed

enterpriseobject

An enterprise on GitHub.

installationobject

The GitHub App installation. This property is included when the event is configured for and sent to a GitHub App.

organizationobject

A GitHub organization.

repositoryobject必须

A repository on GitHub.

senderobject必须

A GitHub user.

workflowobject or null必须
workflow_run必须