Ensure teamReviewer list contains unique team names before sending to API

Signed-off-by: Daniel Laird <daniel.laird@ovo.com>
This commit is contained in:
Daniel Laird
2024-01-12 15:31:56 +00:00
parent b8e9eb3f73
commit 7e7319bcb0
2 changed files with 3 additions and 3 deletions
@@ -377,7 +377,7 @@ describe('createPublishGithubPullRequestAction', () => {
branchName: 'new-app',
description: 'This PR is really good',
reviewers: ['foobar'],
teamReviewers: ['team-foo'],
teamReviewers: ['team-foo', 'team-foo', 'team-bar'],
};
mockDir.setContent({ [workspacePath]: {} });
@@ -401,7 +401,7 @@ describe('createPublishGithubPullRequestAction', () => {
repo: 'myrepo',
pull_number: 123,
reviewers: ['foobar'],
team_reviewers: ['team-foo'],
team_reviewers: ['team-foo', 'team-bar'],
});
});
@@ -372,7 +372,7 @@ export const createPublishGithubPullRequestAction = (
repo: pr.repo,
pull_number: pr.number,
reviewers,
team_reviewers: teamReviewers,
team_reviewers: teamReviewers ? [...new Set(teamReviewers)] : undefined,
});
const addedUsers = result.data.requested_reviewers?.join(', ') ?? '';
const addedTeams = result.data.requested_teams?.join(', ') ?? '';