init
This commit is contained in:
26
remove-all.ts
Normal file
26
remove-all.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import 'dotenv/config';
|
||||
|
||||
import { Octokit } from 'octokit';
|
||||
import { giteaApi } from 'gitea-js';
|
||||
|
||||
const github = new Octokit({
|
||||
auth: process.env.GITHUB_TOKEN,
|
||||
});
|
||||
|
||||
const response = await fetch('https://gitea.olsen.cloud/api/v1/user/repos', {
|
||||
headers: {
|
||||
authorization: `Bearer ${process.env.GITEA_TOKEN}`,
|
||||
},
|
||||
})
|
||||
const repos = await response.json();
|
||||
for (const repo of repos) {
|
||||
const response = await fetch(`https://gitea.olsen.cloud/api/v1/repos/${repo.owner.login}/${repo.name}`, {
|
||||
method: 'delete',
|
||||
headers: {
|
||||
authorization: `Bearer ${process.env.GITEA_TOKEN}`,
|
||||
},
|
||||
});
|
||||
|
||||
console.log(response.status, repo.owner.login, repo.name)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user