Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions pkg/provider/gitlab/parse_payload.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (v *Provider) ParsePayload(ctx context.Context, run *params.Run, request *h
// GitLab sends same event for both Tag creation and deletion i.e. "Tag Push Hook".
// if gitEvent.After is containing all zeros and gitEvent.CheckoutSHA is empty
// it is Delete "Tag Push Hook".
if isZeroSHA(gitEvent.After) && gitEvent.CheckoutSHA == "" {
if provider.IsZeroSHA(gitEvent.After) && gitEvent.CheckoutSHA == "" {
return nil, fmt.Errorf("event Delete %s is not supported", event)
}

Expand Down Expand Up @@ -319,7 +319,3 @@ func (v *Provider) handleCommitCommentEvent(ctx context.Context, event *gitlab.C
v.Logger.Infof("gitlab commit_comment: pipelinerun %s has been requested on %s/%s#%s", action, processedEvent.Organization, processedEvent.Repository, processedEvent.SHA)
return processedEvent, nil
}

func isZeroSHA(sha string) bool {
return sha == "0000000000000000000000000000000000000000"
}
Loading
โšก