Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
14Richa committed Jul 25, 2023
1 parent dc5b57b commit 504fbfe
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/update-maintainers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,15 @@ jobs:

// Update for removed usernames
for (const username of removedUsernames) {
const maintainer = maintainers.find(maintainer => maintainer.github === username);
if (maintainer) {
const repoIndex = maintainer.repos.indexOf(repoName);
const index = maintainers.findIndex(maintainer => maintainer.github === username);
if (index !== -1) {
const maintainer = maintainers[index];
const repoIndex = maintainer.repos.findIndex(repo => repo === 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 504fbfe

Please sign in to comment.