Skip to content

Commit

Permalink
feat: map partner avatars
Browse files Browse the repository at this point in the history
  • Loading branch information
zugdev committed Jan 25, 2025
1 parent 3ccb1ac commit 53cbb1f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export async function main() {
const partnerRepoUrls = await getPartnerRepoUrls();
const taskList: GitHubIssue[] = [];
const pullRequestList: GitHubPullRequest[] = [];
const partnerAvatarList: OrgNameAndAvatarUrl[] = [];
const partnerAvatarMap: Map<string, OrgNameAndAvatarUrl> = new Map();

// for each project URL
for (const partnerRepoUrl of partnerRepoUrls) {
Expand All @@ -29,11 +29,15 @@ export async function main() {
const pullRequests: GitHubPullRequest[] = await getRepositoryPullRequests(ownerName, repoName);
pullRequestList.push(...pullRequests);

// get partner profile picture
const org: OrgNameAndAvatarUrl = await getPartnerAvatars(ownerName);
partnerAvatarList.push(org);
// get partner profile picture if not already in the map
if (!partnerAvatarMap.has(ownerName)) {
const org: OrgNameAndAvatarUrl = await getPartnerAvatars(ownerName);
partnerAvatarMap.set(ownerName, org);
}
}

const partnerAvatarList: OrgNameAndAvatarUrl[] = Array.from(partnerAvatarMap.values());

await commitTasks(taskList);
await commitPullRequests(pullRequestList);
await commitPartnerAvatars(partnerAvatarList);
Expand Down

0 comments on commit 53cbb1f

Please sign in to comment.