Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 52dacf0

Browse files
authoredApr 6, 2023
Update services/actions/notifier_helper.go
1 parent 98a539b commit 52dacf0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed
 

‎services/actions/notifier_helper.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,12 @@ func notify(ctx context.Context, input *notifyInput) error {
127127
defer gitRepo.Close()
128128

129129
ref := input.Ref
130-
if ref == "" || input.Event == webhook_module.HookEventDelete {
130+
if input.Event == webhook_module.HookEventDelete {
131+
// The event is deleting a reference, so it will fail to get the commit for a deleted reference.
132+
// Set ref to empty string to fall back to the default branch.
133+
ref = ""
134+
}
135+
if ref == "" {
131136
ref = input.Repo.DefaultBranch
132137
}
133138

0 commit comments

Comments
 (0)
Please sign in to comment.