Skip to content

Commit ba42196

Browse files
authored
Revert "Avoid 0 new commits messages to be send (#11082)"
This reverts commit 6034f8b.
1 parent e9dc3bc commit ba42196

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

modules/repofiles/action.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,12 +249,12 @@ func CommitRepoAction(optsList ...*CommitRepoActionOptions) error {
249249
IsPrivate: repo.IsPrivate,
250250
}
251251

252+
var isHookEventPush = true
252253
switch opType {
253254
case models.ActionCommitRepo: // Push
254255
if opts.IsNewBranch() {
255256
notification.NotifyCreateRef(pusher, repo, "branch", opts.RefFullName)
256257
}
257-
notification.NotifyPushCommits(pusher, repo, opts.RefFullName, opts.OldCommitID, opts.NewCommitID, opts.Commits)
258258
case models.ActionDeleteBranch: // Delete Branch
259259
notification.NotifyDeleteRef(pusher, repo, "branch", opts.RefFullName)
260260

@@ -263,6 +263,12 @@ func CommitRepoAction(optsList ...*CommitRepoActionOptions) error {
263263

264264
case models.ActionDeleteTag: // Delete Tag
265265
notification.NotifyDeleteRef(pusher, repo, "tag", opts.RefFullName)
266+
default:
267+
isHookEventPush = false
268+
}
269+
270+
if isHookEventPush {
271+
notification.NotifyPushCommits(pusher, repo, opts.RefFullName, opts.OldCommitID, opts.NewCommitID, opts.Commits)
266272
}
267273
}
268274

0 commit comments

Comments
 (0)