github tag build should not have changed files (#698)

This commit is contained in:
Anbraten 2022-01-16 18:44:44 +01:00 committed by GitHub
parent 549996cbcd
commit 2f780193b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -187,12 +187,15 @@ func convertPushHook(from *webhook) *model.Build {
Sender: from.Sender.Login,
ChangedFiles: files,
}
if len(build.Author) == 0 {
build.Author = from.Head.Author.Username
}
// if len(build.Email) == 0 {
// TODO: default to gravatar?
// }
if strings.HasPrefix(build.Ref, "refs/tags/") {
// just kidding, this is actually a tag event. Why did this come as a push
// event we'll never know!
@ -202,7 +205,11 @@ func convertPushHook(from *webhook) *model.Build {
if strings.HasPrefix(from.BaseRef, "refs/heads/") {
build.Branch = strings.Replace(from.BaseRef, "refs/heads/", "", -1)
}
// tags should not have changed files
build.ChangedFiles = nil
}
return build
}