mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2026-04-15 01:41:56 +00:00
Ignore gitlab push events without commits (#3339)
Example of the resulting buggy pipeline: 
This commit is contained in:
@@ -655,6 +655,9 @@ func (g *GitLab) Hook(ctx context.Context, req *http.Request) (*model.Repo, *mod
|
||||
|
||||
return repo, pipeline, nil
|
||||
case *gitlab.PushEvent:
|
||||
if event.TotalCommitsCount == 0 {
|
||||
return nil, nil, &forge_types.ErrIgnoreEvent{Event: string(eventType), Reason: "no commits"}
|
||||
}
|
||||
return convertPushHook(event)
|
||||
case *gitlab.TagEvent:
|
||||
return convertTagHook(event)
|
||||
|
||||
Reference in New Issue
Block a user