Skip to content

Commit db0e832

Browse files
zakiskchmouel
authored andcommitted
enhance: Use Client Function for API Call in ParsePayload
This commit refactors the direct API call made using the ghClient variable in ParsePayload.go to instead use the standardized Provider.Client function. This change ensures consistency across API interactions and enables proper metrics recording for all GitHub API calls. Signed-off-by: Zaki Shaikh <[email protected]>
1 parent 0ad67b6 commit db0e832

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/provider/github/parse_payload.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ func (v *Provider) getPullRequestsWithCommit(ctx context.Context, sha, org, repo
233233

234234
for {
235235
// Use the "List pull requests associated with a commit" API to check if the commit is part of any open PR
236-
prs, resp, err := v.ghClient.PullRequests.ListPullRequestsWithCommit(ctx, org, repo, sha, opts)
236+
prs, resp, err := v.Client().PullRequests.ListPullRequestsWithCommit(ctx, org, repo, sha, opts)
237237
if err != nil {
238238
// Log the error for debugging purposes
239239
v.Logger.Debugf("Failed to list pull requests for commit %s in %s/%s: %v", sha, org, repo, err)

0 commit comments

Comments
 (0)