Skip to content

Handle deleted refs in push notifications - #39

Merged
hnrobert merged 1 commit into
hnrobert:developfrom
HarleyZHOUzzz:fix/deleted-push-notification
Nov 1, 2026
Merged

hnrobert merged 1 commit into
hnrobert:developfrom
HarleyZHOUzzz:fix/deleted-push-notification

Conversation

@HarleyZHOUzzz

Copy link
Copy Markdown
Contributor

问题

删除远程分支或标签时,GitHub 会发送 push webhook。
原有代码没有检查 payload 中的 deleted 字段,因此删除操作会被当作普通推送,
飞书卡片显示“New Push / pushed 0 commits”。

修改

  • 根据 payload.deleted 识别删除型 push,并在同时为强制推送时优先显示删除通知。
  • 根据 ref 前缀为删除通知提供 ref_type,区分 branch 和 tag;
    卡片保留原始 ref。
  • 在中英文 push 模板中增加删除卡片,沿用现有 delete 卡片的样式和文案。
  • 保留普通推送、强制推送及独立 delete 事件的原有行为。

Related to #38

@hnrobert hnrobert linked an issue Nov 1, 2026 that may be closed by this pull request
@hnrobert hnrobert changed the title fix: handle deleted refs in push notifications Handle deleted refs in push notifications Nov 1, 2026
@hnrobert
hnrobert merged commit 6cc23a7 into hnrobert:develop Nov 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants