Help us learn about your current experience with the documentation. Take the survey.

Discord 通知

  • Tier: Free, Premium, Ultimate
  • Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated

Discord 通知集成会将 GitLab 的事件通知发送到创建 webhook 的频道。

要将 GitLab 事件通知发送到 Discord 频道,请在 Discord 中创建 webhook,然后在 GitLab 中进行配置。

创建 webhook

  1. 打开你想要接收 GitLab 事件通知的 Discord 频道。
  2. 从频道菜单中选择 编辑频道
  3. 选择 集成
  4. 如果没有现有的 webhook,请选择 创建 Webhook。否则,选择 查看 Webhooks,然后选择 新建 Webhook
  5. 输入要发布消息的机器人的名称。
  6. 可选。编辑头像。
  7. WEBHOOK URL 字段中复制 URL。
  8. 选择 保存

在 GitLab 中配置创建的 webhook

先决条件:

  • 你必须使用 Discord URL (https://discord.com/api/webhooks/webhook-snowflake/webhook-token)。

使用在 Discord 频道中创建的 webhook URL,你可以在 GitLab 中设置 Discord 通知集成。

  1. 在左侧边栏,选择 搜索或跳转至 并找到你的项目。
  2. 选择 设置 > 集成
  3. 选择 Discord 通知
  4. 确保 启用 开关已打开。
  5. 将你 之前创建 的 webhook URL 粘贴到 Webhook 字段中。
  6. 选择你想要发送通知到 Discord 的 GitLab 事件对应的复选框。
  7. 对于你选择的每个复选框,可选地输入一个你 已配置 的新 Discord webhook URL,以覆盖 Webhook 字段中的默认 URL。
  8. 配置剩余的选项,然后选择 保存更改 按钮。

你为创建 webhook 的 Discord 频道现在会接收已配置的 GitLab 事件的通知。