Skip to content

Commit

Permalink
minor fix in remove codeowner code block
Browse files Browse the repository at this point in the history
  • Loading branch information
14Richa committed Jul 18, 2023
1 parent 2acd8b3 commit cf8d9fd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/update-maintainers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,16 @@ jobs:

// Update for removed usernames
for (const username of removedUsernames) {
const index = maintainers.findIndex(maintainer => maintainer.github === username);
if (index !== -1) {
const maintainer = maintainers[index];
const maintainer = maintainers.find(maintainer => maintainer.github === username);
if (maintainer) {
const repoIndex = maintainer.repos.indexOf(repoName);

if (repoIndex !== -1) {
maintainer.repos.splice(repoIndex, 1);
console.log(`Removed repository ${repoName} from maintainer ${username}`);

if (maintainer.repos.length === 0) {
const index = maintainers.indexOf(maintainer);
maintainers.splice(index, 1);
console.log(`Removed maintainer ${username} as they have no other repositories`);
}
Expand Down

0 comments on commit cf8d9fd

Please sign in to comment.