diff --git a/action.yml b/action.yml index d863bc0..61fed4e 100644 --- a/action.yml +++ b/action.yml @@ -26,4 +26,4 @@ outputs: runs: using: 'docker' - image: 'docker://ghcr.io/paritytech/review-bot/action:1.0.0' + image: 'docker://ghcr.io/paritytech/review-bot/action:1.0.1' diff --git a/package.json b/package.json index daf1c6a..733ed8f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "review-bot", - "version": "1.0.0", + "version": "1.0.1", "description": "Have custom review rules for PRs with auto assignment", "main": "src/index.ts", "scripts": { diff --git a/src/github/pullRequest.ts b/src/github/pullRequest.ts index 6f22493..1a512d6 100644 --- a/src/github/pullRequest.ts +++ b/src/github/pullRequest.ts @@ -96,14 +96,16 @@ export class PullRequestApi { const approvals = latestReviews.filter((review) => caseInsensitiveEqual(review.state, "approved")); this.usersThatApprovedThePr = approvals.map((approval) => approval.user.login); } - this.logger.debug(`PR approvals are ${JSON.stringify(this.usersThatApprovedThePr)}`); + + const approvals = this.usersThatApprovedThePr; if (countAuthor) { - // If this value is true, we add the author to the list of approvals - return [...this.usersThatApprovedThePr, this.pr.user.login]; + this.logger.info("Counting author in list of approvals"); + approvals.push(this.pr.user.login); } + this.logger.debug(`PR approvals are ${JSON.stringify(approvals)}`); - return this.usersThatApprovedThePr; + return approvals; } /** Returns the login of the PR's author */ diff --git a/src/github/teams.ts b/src/github/teams.ts index 9c8e054..1c2ce9c 100644 --- a/src/github/teams.ts +++ b/src/github/teams.ts @@ -33,6 +33,7 @@ export class GitHubTeamsApi implements TeamApi { this.logger.debug(`Fetching team '${teamName}'`); const { data } = await this.api.rest.teams.listMembersInOrg({ org: this.org, team_slug: teamName }); const members = data.map((d) => d.login); + this.logger.debug(`Members are ${JSON.stringify(members)}`); this.teamsCache.set(teamName, members); } return this.teamsCache.get(teamName) as string[];