Skip to content

Commit

Permalink
small enhancement to gitprovider package
Browse files Browse the repository at this point in the history
Signed-off-by: Kent Rancourt <kent.rancourt@gmail.com>
  • Loading branch information
krancour committed Sep 16, 2024
1 parent f33df8f commit f93b913
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/gitprovider/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ func convertGithubPR(ghPR *github.PullRequest) *gitprovider.PullRequest {
State: prState,
MergeCommitSHA: ptr.Deref(ghPR.MergeCommitSHA, ""),
Object: ghPR,
HeadSHA: ptr.Deref(ghPR.Head.SHA, ""),
}
}

Expand Down
1 change: 1 addition & 0 deletions internal/gitprovider/gitlab/gitlab.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ func convertGitlabMR(glMR *gitlab.MergeRequest) *gitprovider.PullRequest {
State: prState,
MergeCommitSHA: glMR.MergeCommitSHA,
Object: glMR,
HeadSHA: glMR.SHA,
}
}

Expand Down
2 changes: 2 additions & 0 deletions internal/gitprovider/gitprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ type PullRequest struct {
MergeCommitSHA string `json:"mergeCommitSHA"`
// Object is the underlying object from the provider
Object any `json:"-"`
// HeadSHA is the SHA of the head commit
HeadSHA string `json:"headSHA"`
}

func (pr *PullRequest) IsOpen() bool {
Expand Down

0 comments on commit f93b913

Please sign in to comment.