-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
72 lines (55 loc) · 2.11 KB
/
index.js
File metadata and controls
72 lines (55 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import axios from 'axios';
import fs from 'fs';
const ORG = 'debug-community';
const TOKEN = process.env.GH_TOKEN;
async function generateReadme() {
const members = await axios.get(`https://api.github.com/orgs/${ORG}/members`, {
headers: { Authorization: `Bearer ${TOKEN}` },
});
console.log(`Found ${members.data.length} members in the organization ${ORG}`);
const profileData = await Promise.all(
members.data.map(async (member) => {
const user = await axios.get(member.url, {
headers: { Authorization: `Bearer ${TOKEN}` },
});
console.log(`Fetching data for ${user.data.login}`);
return {
login: user.data.login,
avatar_url: user.data.avatar_url,
};
})
);
console.log('Generating README...');
const avatars = profileData
.map(
(user) =>
`<a href="https://github.com/${user.login}">
<img src="${user.avatar_url}" width="60" alt="${user.login}" />
</a>`
)
.join('\n');
const readmeContent = `
## Hi there 👋
<!--
**Here are some ideas to get you started:**
🙋♀️ A short introduction - what is your organization all about?
🌈 Contribution guidelines - how can the community get involved?
👩💻 Useful resources - where can the community find your docs? Is there anything else the community should know?
🍿 Fun facts - what does your team eat for breakfast?
🧙 Remember, you can do mighty things with the power of [Markdown](https://docs.github.com/github/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax)
-->
Debug 커뮤니티의 GitHub Organization 입니다.
## 👥 Organization Members
${avatars}
## Want to join?
<a href="https://discord.gg/7sAYdbff">
<img src="https://skillicons.dev/icons?i=discord" width="32" height="32" alt="Discord"/>
</a>
## Contect
<a href="mailto:debug331@gmail.com">
<img src="https://upload.wikimedia.org/wikipedia/commons/4/4e/Gmail_Icon.png" width="32" height="32" alt="Gmail"/>
</a>
`;
fs.writeFileSync('profile/README.md', readmeContent);
}
generateReadme();