Skip to content

删除分支显示为了 New push / push 0 commits #38

Closed

Description

@hnrobert
Image

Activity

  1. hnrobert commented on Oct 31, 2026

    @hnrobert
    OwnerAuthor

    找到原因回复在这里即可 😈

  2. HarleyZHOUzzz commented on Oct 31, 2026

    @HarleyZHOUzzz
    Contributor

    原因:删除远程分支也会触发 push 事件,但目前代码没有判断这是一次删除操作。

    internal/template/template.go 第 375–380 行只判断了是不是强制推送:

    case "push":
        if forced, ok := payload["forced"].(bool); ok && forced {
            tags = append(tags, "force")
        } else {
            tags = append(tags, "default")
        }

    删除分支时会走到 else,使用普通推送模板。模板标题写的是 New Push,而这次没有提交,所以就显示成了 pushed 0 commits。

  3. Shr-CS commented on Oct 31, 2026

    @Shr-CS

    删分支时会发 push webhook,但代码没处理 deleted 标志。push 时若 deleted==true 打 deleted 标签,并新增对应卡片文案。

  4. linked a pull request that will close this issueHandle deleted refs in push notifications #39on Nov 1, 2026
  5. linked a pull request that will close this issueHandle deleted refs in push notifications #40on Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions