From a2e06da489e8e293ba1c249c3052d8e5d37d250e Mon Sep 17 00:00:00 2001 From: Gerrit Date: Mon, 26 Feb 2024 11:01:05 +0100 Subject: [PATCH] Fix. --- pkg/webhooks/github/actions/aggregate_releases.go | 6 +++--- pkg/webhooks/github/actions/release_drafter.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/webhooks/github/actions/aggregate_releases.go b/pkg/webhooks/github/actions/aggregate_releases.go index c1cf0a8..f8c1307 100644 --- a/pkg/webhooks/github/actions/aggregate_releases.go +++ b/pkg/webhooks/github/actions/aggregate_releases.go @@ -129,7 +129,7 @@ func (r *AggregateReleases) AggregateRelease(ctx context.Context, p *AggregateRe } if openPR != nil { - frozen, err := isReleaseFreeze(ctx, r.client.GetV3Client(), openPR) + frozen, err := isReleaseFreeze(ctx, r.client.GetV3Client(), openPR, r.client.Organization(), r.repoName) if err != nil { return err } @@ -237,8 +237,8 @@ func findOpenReleasePR(ctx context.Context, client *v3.Client, owner, repo, bran return nil, nil } -func isReleaseFreeze(ctx context.Context, client *v3.Client, pr *v3.PullRequest) (bool, error) { - comments, _, err := client.PullRequests.ListComments(ctx, *pr.Base.Repo.Owner.Name, *pr.Base.Repo.Name, pointer.SafeDeref(pr.Number), &v3.PullRequestListCommentsOptions{ +func isReleaseFreeze(ctx context.Context, client *v3.Client, pr *v3.PullRequest, owner, repo string) (bool, error) { + comments, _, err := client.PullRequests.ListComments(ctx, owner, repo, pointer.SafeDeref(pr.Number), &v3.PullRequestListCommentsOptions{ Direction: "desc", }) if err != nil { diff --git a/pkg/webhooks/github/actions/release_drafter.go b/pkg/webhooks/github/actions/release_drafter.go index 4481f63..533ba46 100644 --- a/pkg/webhooks/github/actions/release_drafter.go +++ b/pkg/webhooks/github/actions/release_drafter.go @@ -168,7 +168,7 @@ func (r *releaseDrafter) draft(ctx context.Context, p *releaseDrafterParams) err } if openPR != nil { - frozen, err := isReleaseFreeze(ctx, r.client.GetV3Client(), openPR) + frozen, err := isReleaseFreeze(ctx, r.client.GetV3Client(), openPR, r.client.Organization(), r.repoName) if err != nil { return err }