👋 We've unified all of GitHub's product documentation in one place! Check out the content for REST API, GraphQL API, and Developers. Learn more on the GitHub blog.


我们经常发布文档更新,此页面的翻译可能仍在进行中。有关最新信息,请访问英文文档。如果此页面上的翻译有问题,请告诉我们
文章版本: GitHub.com

配置通知

选择 GitHub 上您想要接收其通知的活动类型以及您希望如何发送这些更新。

本文内容

Were you able to find what you were looking for?

通知递送选项

You have three basic options for notification delivery:

  • the notifications inbox on GitHub
  • the notifications inbox on GitHub for mobile, which syncs with the inbox on GitHub
  • an email client that uses a verified email address, which can also sync with the notifications inbox on GitHub and GitHub for mobile

要在 GitHub 和 GitHub for mobile 上使用通知收件箱,必须在通知设置中启用 Web 和移动通知。 For more information, see "Choosing your notification settings."

提示:如果您同时接收 Web 和电子邮件通知,您可以自动同步通知的已读或未读状态,以便在您阅读相应的电子邮件通知后,Web 通知自动标记为已读。 要启用此同步,您的电子邮件客户端必须能够查看来自 'notifications@github.com' 的图像。

Benefits of the notifications inbox

The notifications inbox on GitHub and GitHub for mobile includes triaging options designed specifically for your GitHub notifications flow, including options to:

  • 一次对多种通知进行分类。
  • 将已完成的通知标记为完成并从收件箱中删除它们。 要查看标记为完成的所有通知,请使用 is:done 查询。
  • 保存通知以供以后查看。 保存的通知将在收件箱中标记并无限期保留。 要查看所有已保存的通知,请使用 is:saved 查询。
  • 取消订阅并从收件箱中删除通知。
  • 从通知收件箱预览 GitHub 上产生通知的议题、拉取请求或团队讨论。
  • 使用 reasons 标签查看收件箱中收到通知的最新原因之一。
  • 创建自定义过滤器,以便按需要关注不同的通知。
  • 按仓库或日期对收件箱中的通知进行分组,以快速概览通知,减少上下文切换

In addition, the notifications inbox on GitHub for mobile allows you to triage notifications in dark mode and receive push notifications for direct mentions. For more information, see "Enabling push notifications with GitHub for mobile" or "GitHub for mobile."

对通知使用电子邮件客户端的优点

One benefit of using an email client is that all of your notifications can be kept indefinitely depending on your email client's storage capacity. Your inbox notifications are only kept for 5 months unless you've marked them as Saved. Saved notifications are kept indefinitely. For more information about your inbox's retention policy, see "About notifications."

Sending notifications to your email client also allows you to customize your inbox according to your email client's settings, which can include custom or color-coded labels.

Email notifications also allow flexibility with the types of notifications you receive and allow you to choose different email addresses for updates. For example, you can send certain notifications for a repository to a verified personal email address. For more information, about your email customization options, see "Customizing your email notifications."

关于参与和查看通知

When you watch a repository, you're subscribing to updates for activity in that repository. Similarly, when you watch a specific team's discussions, you're subscribing to all conversation updates on that team's page. To see repositories that you're watching, see https://github.com/watching. For more information, see "Managing subscriptions and notifications on GitHub."

Anytime you comment in a conversation or when someone @mentions your username, you are participating in a conversation. By default, you are automatically subscribed to a conversation when you participate in it. You can unsubscribe from a conversation you've participated in manually by clicking Unsubscribe on the issue or pull request or through the Unsubscribe option in the notifications inbox.

For conversations you're watching or participating in, you can choose whether you want to receive notifications by email or through the notifications inbox on GitHub and GitHub for mobile.

Participating and watching notifications options

例如:

  • 如果您不希望将通知发送到您的电子邮件地址,请取消选中 email(电子邮件)以便参与和查看通知。
  • 如果您希望在参与对话时通过电子邮件接收通知,则可以选中“Participating(参与)”下的 email(电子邮件)

If you do not enable watching or participating notifications for web and mobile, then your notifications inbox will not have any updates.

自定义电子邮件通知

在启用电子邮件通知后,GitHub 将以多部分电子邮件向您发送通知,其中包含内容的 HTML 和明文副本。 电子邮件通知内容包含出现在 GitHub 上的原始内容中的任何 Markdown、@提及、表情符号、哈希链接等。 如果您只想查看电子邮件中的文本,可以配置电子邮件客户端只显示明文副本。

提示:如果您同时接收 Web 和电子邮件通知,您可以自动同步通知的已读或未读状态,以便在您阅读相应的电子邮件通知后,Web 通知自动标记为已读。 要启用此同步,您的电子邮件客户端必须能够查看来自 'notifications@github.com'的图像。

如果您使用 Gmail,可以单击通知电子邮件旁边的按钮访问生成该通知的原始议题或拉取请求。

Gmail 中的按钮

Choose a default email address where you want to send updates for conversations you're participating in or watching. You can also specify which activity on GitHub you want to receive updates for using your default email address. For example, choose whether you want updates to your default email from:

  • 对问题和拉取请求的评论。
  • 拉取请求审查.
  • 拉取请求推送。
  • 您自己的更新,例如当您打开、评论或关闭议题或拉取请求时。

Depending on the organization that owns the repository, you can also send notifications to different email addresses for specific repositories. For example, you can send notifications for a specific public repository to a verified personal email address. Your organization may require the email address to be verified for a specific domain. 更多信息请参阅“选择接收组织的电子邮件通知的位置”。

只有在通知设置中选择了接收电子邮件通知时,才会收到通知电子邮件。

如果您所在的组织将电子邮件通知限于已批准的电子邮件域,则您需要验证该域的电子邮件地址才可接收有关组织中活动的电子邮件通知。 更多信息请参阅“将电子邮件通知限于经批准的域”。

过滤电子邮件通知

GitHub 发送的每封电子邮件通知都包含标头信息。 每封电子邮件的标头信息都是一致的,因此可用于电子邮件客户端中过滤或转发所有 GitHub 通知,或特定类型的 GitHub 通知。

If you believe you're receiving notifications that don't belong to you, examine the X-GitHub-Recipient and X-GitHub-Recipient-Address headers. These headers show who the intended recipient is. Depending on your email setup, you may receive notifications intended for another user.

来自 GitHub 的电子邮件通知包含以下标头信息:

标头信息
From 地址此地址始终是 'notifications@github.com'。
To 字段此字段直接连接到线程。 如果您回复电子邮件,将会为对话添加新评论。
Cc 地址如果您订阅了对话,GitHub 将会 Cc 给您。 第二个 Cc 电子邮件地址与通知原因匹配。 这些通知原因的后缀是 @noreply.github.com。 可能的通知原因包括:
  • assign:您被分配到议题或拉取请求。
  • author:您创建了议题或拉取请求。
  • comment:您评论了议题或拉取请求。
  • manual:您手动订阅的议题或拉取请求有更新。
  • mention:您提及了议题或拉取请求。
  • push:有人提交了您订阅的拉取请求。
  • review_requested:您或您所在的团队已请求审查拉取请求。
  • security_alert:GitHub 检测到您要接收其漏洞警报的仓库中存在漏洞。
  • state_change:您订阅的议题或拉取请求已关闭或打开。
  • subscribed:您查看的仓库有更新。
  • team_mention:您所属的团队在议题或拉取请求中被提及。
  • your_activity:您打开、评论或关闭了议题或拉取请求。
mailing list 字段此字段识别仓库名称及其所有者。 此地址的格式始终是 <仓库名称>.<仓库所有者>.github.com
X-GitHub-Severity 字段会影响一个或多个仓库的安全警报的电子邮件通知包含 X-GitHub Severity 标头字段。 您可以使用 X-GitHub Severity 标头字段的值过滤电子邮件通知安全警报。 可能的严重程度等级包括:
  • 关键
更多信息请参阅“关于依赖项漏洞的安全警报”。

选择通知设置

  1. 在任何页面的右上角,单击
    表示任何未读消息的通知
  2. 在左侧边栏中的仓库列表下,使用“Manage notifications(管理通知)”下拉按钮单击 Notification settings(通知设置)
    管理通知下拉菜单选项
  3. On the notifications settings page, choose how you receive notifications when:

自动关注

By default, anytime you gain access to a new repository, you will automatically begin watching that repository. Anytime you join a new team, you will automatically be subscribed to updates and receive notifications when that team is @mentioned. If you don't want to automatically be subscribed, you can unselect the automatic watching options.

Automatic watching options

If "Automatically watch repositories" is disabled, then you will not automatically watch your own repositories. You must navigate to your repository page and choose the watch option.

选择接收组织的电子邮件通知的位置

如果您属于某个组织,您可以选择要接收组织活动通知的电子邮件帐户。 例如,如果您属于某个工作组织,您可能希望通知发送到您的工作电子邮件地址,而不是您的个人地址。

只有在通知设置中选择了接收电子邮件通知时,才会收到通知电子邮件。

如果您所在的组织将电子邮件通知限于已批准的电子邮件域,则您需要验证该域的电子邮件地址才可接收有关组织中活动的电子邮件通知。 更多信息请参阅“将电子邮件通知限于经批准的域”。

  1. 在任何页面的右上角,单击
    表示任何未读消息的通知
  2. 在左侧边栏中的仓库列表下,使用“Manage notifications(管理通知)”下拉按钮单击 Notification settings(通知设置)
    管理通知下拉菜单选项
  3. 在“Default notification email(默认通知电子邮件)”下,选择要接收通知的电子邮件地址。
    默认通知电子邮件地址下拉菜单
  4. 单击 Save(保存)

自定义每个组织的电子邮件路由

If you are a member of more than one organization, you can configure each one to send notifications to any of your verified email addresses. For more information, see "Verifying your email address."

  1. 在任何页面的右上角,单击
    表示任何未读消息的通知
  2. 在左侧边栏中的仓库列表下,使用“Manage notifications(管理通知)”下拉按钮单击 Notification settings(通知设置)
    管理通知下拉菜单选项
  3. 在“Custom routing(自定义路由)”下,在列表中找到您组织的名称。
    组织和电子邮件地址列表
  4. 在要更改的电子邮件地址旁边单击 Edit(编辑)
    编辑组织的电子邮件地址
  5. 选择一个经验证电子邮件地址,然后单击 Save(保存)
    切换每个组织的电子邮件地址

Security alert options

Choose how you want to receive security alerts for repositories that you are watching. You can receive security alerts in your inbox, as a banner on GitHub, on the command line, through email, or some combination of these options.

If you want to receive security alerts by email, choose whether you want a weekly email summary of vulnerabilities for up 10 repositories or a new email each time a vulnerability is detected. 更多信息请参阅“关于依赖项漏洞的安全警报”。

Security alerts options

GitHub 操作 notification options

Choose how you want to receive workflow run updates for repositories that you are watching that are set up with GitHub 操作. You can also choose to only receive notifications for failed workflow runs.

Notification options for GitHub Actions

Enabling push notifications with GitHub for mobile

When you install GitHub for mobile, you will automatically be opted into web notifications. You can then enable push notifications for direct mentions within the app.

You can only receive notifications for pushes to repositories on GitHub for mobile at this time.

Enabling push notifications with GitHub for iOS

  1. Above "Home", tap your profile photo.
  2. To view your settings, tap .
    Settings icon for GitHub for iOS
  3. To update your notification settings, tap Push notifications.
  4. To turn on push notifications for direct mentions, use the Direct Mentions toggle.

Enabling push notifications with GitHub for Android

  1. Above "Home", tap your profile photo.
  2. To view your settings, tap .
    Settings icon for GitHub for Android
  3. To turn on push notifications for direct mentions, use the Direct mentions toggle.

Were you able to find what you were looking for?

问问别人

找不到要找的内容?

联系我们