ci: use a set instead of array for team reviewers

Adding the same team multiple times will fails the review job.
This commit is contained in:
dundargoc 2023-04-07 22:28:27 +02:00
parent 2d78e656b7
commit 4cb2b747c0

View File

@ -7,17 +7,17 @@ module.exports = async ({github, context}) => {
const labels = pr_data.data.labels.map(e => e.name)
const reviewers = new Set()
const team_reviewers = new Array()
const team_reviewers = new Set()
if (labels.includes('api')) {
reviewers.add("bfredl")
}
if (labels.includes('build')) {
team_reviewers.push('ci');
team_reviewers.add('ci');
}
if (labels.includes('ci')) {
team_reviewers.push('ci');
team_reviewers.add('ci');
}
if (labels.includes('column')) {
@ -55,7 +55,7 @@ module.exports = async ({github, context}) => {
}
if (labels.includes('lsp')) {
team_reviewers.push('lsp');
team_reviewers.add('lsp');
}
if (labels.includes('platform:nix')) {
@ -72,7 +72,7 @@ module.exports = async ({github, context}) => {
}
if (labels.includes('treesitter')) {
team_reviewers.push('treesitter');
team_reviewers.add('treesitter');
}
if (labels.includes('typo')) {
@ -97,6 +97,6 @@ module.exports = async ({github, context}) => {
repo: context.repo.repo,
pull_number: context.issue.number,
reviewers: Array.from(reviewers),
team_reviewers: team_reviewers
team_reviewers: Array.from(team_reviewers)
});
}