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

Configuring notifications

Choose the type of activity on GitHub that you want to receive notifications for and how you want these updates delivered.

本文内容

Notification delivery options

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 on GitHub and GitHub for mobile

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

  • Triage multiple notifications at once.
  • Mark completed notifications as Done and remove them from your inbox. To view all of your notifications marked as Done, use the is:done query.
  • Save a notification to review later. Saved notifications are flagged in your inbox and kept indefinitely. To view all of your saved notifications, use the is:saved query.
  • Unsubscribe and remove a notification from your inbox.
  • Preview the issue, pull request, or team discussion where the notification originates on GitHub from within the notifications inbox.
  • See one of the latest reasons you're receiving a notification from your inbox with a reasons label.
  • Create custom filters to focus on different notifications when you want.

Drop-down menu with triage options and selected notifications

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."

Benefits of using an email client for notifications

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."

About participating and watching 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

例如:

  • If you don't want notifications to be sent to your email, unselect email for participating and watching notifications.
  • If you want to receive notifications by email when you've participated in a conversation, then you can select email under "Participating".

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

Customizing your email notifications

在启用电子邮件通知后,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:

  • Comments on issues and pull requests.
  • 拉取请求审查.
  • Pull request pushes.
  • Your own updates, such as when you open, comment on, or close an issue or pull request.

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

Choosing your notification settings

  1. 在任何页面的右上角,单击

    表示任何未读消息的通知

  2. In the left sidebar, under the list of repositories, use the "Manage notifications" drop-down to click Notification settings.

    Manage notifications drop down menu options

  3. On the notifications settings page, choose how you receive notifications when:

Automatic watching

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.

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.

问问别人

找不到要找的内容?

联系我们