Skip to content

Commit

Permalink
fixed case senstive comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
Bullrich authored Jul 26, 2023
1 parent 9610d93 commit b5b1821
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/github/pullRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class PullRequestApi {
repo: this.pr.base.repo.name,
path: configFilePath,
// TODO: Remove this
ref: "self-implementation"
ref: "self-implementation",
});

if (!("content" in data)) {
Expand Down Expand Up @@ -57,7 +57,9 @@ export class PullRequestApi {
const request = await this.api.rest.pulls.listReviews({ ...this.repoInfo, pull_number: this.number });
const reviews = request.data as PullRequestReview[];
this.logger.debug(`List of reviews: ${JSON.stringify(reviews)}`);
const approvals = reviews.filter((review) => review.state === "approved");
const approvals = reviews.filter((review) =>
review.state.localeCompare("approved", undefined, { sensitivity: "accent" }),
);
this.usersThatApprovedThePr = approvals.map((approval) => approval.user.login);
}
this.logger.debug(`PR approvals are ${JSON.stringify(this.usersThatApprovedThePr)}`);
Expand Down

0 comments on commit b5b1821

Please sign in to comment.