diff --git a/api/convert.go b/api/convert.go index 3f42341..b5da35f 100644 --- a/api/convert.go +++ b/api/convert.go @@ -196,6 +196,23 @@ func convertLabel(label *structs.Label) *github.Label { } } +func convertCommitFile(file *structs.ChangedFile) *github.CommitFile { + if file == nil { + return &github.CommitFile{} + } + + return &github.CommitFile{ + Filename: stringPtr(file.Filename), + PreviousFilename: stringPtr(file.PreviousFilename), + Additions: intPtr(file.Additions), + Deletions: intPtr(file.Deletions), + Changes: intPtr(file.Changes), + Status: stringPtr(file.Status), + BlobURL: stringPtr(file.ContentsURL), + RawURL: stringPtr(file.RawURL), + } +} + func translatePrAction(action structs.HookIssueAction) string { translatedAction := ""