mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-09-19 15:01:46 +00:00
github tag build should not have changed files (#698)
This commit is contained in:
@@ -187,12 +187,15 @@ func convertPushHook(from *webhook) *model.Build {
|
|||||||
Sender: from.Sender.Login,
|
Sender: from.Sender.Login,
|
||||||
ChangedFiles: files,
|
ChangedFiles: files,
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(build.Author) == 0 {
|
if len(build.Author) == 0 {
|
||||||
build.Author = from.Head.Author.Username
|
build.Author = from.Head.Author.Username
|
||||||
}
|
}
|
||||||
|
|
||||||
// if len(build.Email) == 0 {
|
// if len(build.Email) == 0 {
|
||||||
// TODO: default to gravatar?
|
// TODO: default to gravatar?
|
||||||
// }
|
// }
|
||||||
|
|
||||||
if strings.HasPrefix(build.Ref, "refs/tags/") {
|
if strings.HasPrefix(build.Ref, "refs/tags/") {
|
||||||
// just kidding, this is actually a tag event. Why did this come as a push
|
// just kidding, this is actually a tag event. Why did this come as a push
|
||||||
// event we'll never know!
|
// event we'll never know!
|
||||||
@@ -202,7 +205,11 @@ func convertPushHook(from *webhook) *model.Build {
|
|||||||
if strings.HasPrefix(from.BaseRef, "refs/heads/") {
|
if strings.HasPrefix(from.BaseRef, "refs/heads/") {
|
||||||
build.Branch = strings.Replace(from.BaseRef, "refs/heads/", "", -1)
|
build.Branch = strings.Replace(from.BaseRef, "refs/heads/", "", -1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// tags should not have changed files
|
||||||
|
build.ChangedFiles = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return build
|
return build
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user