feat: add convertCommitFile

This commit is contained in:
Derrick Hammer 2024-02-11 14:03:03 -05:00
parent 0c78013f38
commit 8abe1e7981
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 17 additions and 0 deletions

View File

@ -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 := ""