feat: Add function to get reviews per PR
Signed-off-by: Matej Focko <me@mfocko.xyz>
This commit is contained in:
parent
8ffd5ca8eb
commit
4c3fcd20e4
1 changed files with 12 additions and 0 deletions
12
main.go
12
main.go
|
@ -117,6 +117,18 @@ func patchFiles(wrapper *wrap.Wrapper, commentsByFile map[string]([]*gitea.PullR
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetReviewsPerPR(client *gitea.Client, prID int64) []int64 {
|
||||||
|
reviews, _, err := client.ListPullReviews(REPOSITORY_OWNER, REPOSITORY_NAME, prID, gitea.ListPullReviewsOptions{})
|
||||||
|
ExitOnError(err)
|
||||||
|
|
||||||
|
result := make([]int64, 0)
|
||||||
|
for _, review := range reviews {
|
||||||
|
result = append(result, review.ID)
|
||||||
|
}
|
||||||
|
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
token := os.Getenv("GITEA_TOKEN")
|
token := os.Getenv("GITEA_TOKEN")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue