Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not ignore Gitea TagHook #2966

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -122,6 +122,14 @@ func (p *parser) Parse(req *http.Request, secretFunc func(string) string) (*core
// push hook contains more information than the tag hook,
// so we choose to use the push hook for tags.
if strings.HasPrefix(v.Ref, "refs/tags/") {
// gitea versions < 1.12 used to send both push and tag
// webhook, however only tag is sent from 1.12 onwards.
// ignore push event here so that older versions don't
// cause duplicated jobs.
if p.client.Driver == scm.DriverGitea {
return nil, nil, nil
}

hook = &core.Hook{
Trigger: core.TriggerHook, // core.TriggerHook
Event: core.EventTag,
@@ -186,7 +194,6 @@ func (p *parser) Parse(req *http.Request, secretFunc func(string) string) (*core
// information, so we choose to use the push hook and
// ignore the native tag hook.
if p.client.Driver == scm.DriverGithub ||
p.client.Driver == scm.DriverGitea ||
p.client.Driver == scm.DriverGitlab {
return nil, nil, nil
}