-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake-public.js
More file actions
50 lines (44 loc) · 1.25 KB
/
make-public.js
File metadata and controls
50 lines (44 loc) · 1.25 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
// Make all git theology repos public via GitHub API
const repos = [
'git-islife.com',
'git-theology.com',
'gittheology.com',
'gittruth.com',
'git-manifesto.com',
'git-islove.com',
'git-ispower.com',
'git-isforever.com',
'git-iseternal.com',
'git-isprivate.com',
'git-ispublic.com',
'git-isyourchoice.com'
];
const token = process.env.GITHUB_TOKEN;
const owner = 'genesalvatore';
async function makePublic() {
console.log('Making repos public...\n');
for (const repo of repos) {
try {
const response = await fetch(`https://api.github.com/repos/${owner}/${repo}`, {
method: 'PATCH',
headers: {
'Authorization': `Bearer ${token}`,
'Accept': 'application/vnd.github+json',
'Content-Type': 'application/json'
},
body: JSON.stringify({ private: false })
});
if (response.ok) {
console.log(`✅ ${repo} is now PUBLIC`);
} else {
const error = await response.json();
console.log(`❌ ${repo} failed: ${error.message}`);
}
} catch (error) {
console.log(`❌ ${repo} error: ${error.message}`);
}
}
console.log('\n✅ All repos are now PUBLIC!');
console.log('\nThe Cathedral is live. 🏛️');
}
makePublic();