mirror of
https://github.com/bendtherules/github-delete-unused-repos.git
synced 2026-08-18 13:52:59 +00:00
Reformat and change step descriptions
This commit is contained in:
@@ -188,7 +188,9 @@ class GithubDetectUnusedRepos {
|
|||||||
username: this.username,
|
username: this.username,
|
||||||
};
|
};
|
||||||
|
|
||||||
const repos: ResponseWithDataArray<RepoFromGetUserRepo> = await this.paginate(
|
const repos: ResponseWithDataArray<
|
||||||
|
RepoFromGetUserRepo
|
||||||
|
> = await this.paginate(
|
||||||
(
|
(
|
||||||
tmpFirstParam: Octokit.ReposGetForUserParams
|
tmpFirstParam: Octokit.ReposGetForUserParams
|
||||||
): Promise<ResponseFromGetUserRepo> => {
|
): Promise<ResponseFromGetUserRepo> => {
|
||||||
@@ -277,7 +279,10 @@ class GithubDetectUnusedRepos {
|
|||||||
|
|
||||||
const allPromiseRepoWithFlagFromParentContrib = allRepoNameWithBranchesAndParent.map(
|
const allPromiseRepoWithFlagFromParentContrib = allRepoNameWithBranchesAndParent.map(
|
||||||
({ repoName, parentRepo }) => {
|
({ repoName, parentRepo }) => {
|
||||||
return this.fetchUserIsNotContributor(parentRepo.owner.login, repoName);
|
return this.fetchUserIsNotContributor(
|
||||||
|
parentRepo.owner.login,
|
||||||
|
repoName
|
||||||
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -305,7 +310,8 @@ class GithubDetectUnusedRepos {
|
|||||||
for (let index = 0; index < repoCount; index++) {
|
for (let index = 0; index < repoCount; index++) {
|
||||||
const tmpObjFromCommit = allRepoWithFlagFromCommit[index];
|
const tmpObjFromCommit = allRepoWithFlagFromCommit[index];
|
||||||
const tmpObjFromForkContrib = allRepoWithFlagFromForkContrib[index];
|
const tmpObjFromForkContrib = allRepoWithFlagFromForkContrib[index];
|
||||||
const tmpObjFromParentContrib = allRepoWithFlagFromParentContrib[index];
|
const tmpObjFromParentContrib =
|
||||||
|
allRepoWithFlagFromParentContrib[index];
|
||||||
|
|
||||||
assert.strictEqual(
|
assert.strictEqual(
|
||||||
tmpObjFromCommit.repoName,
|
tmpObjFromCommit.repoName,
|
||||||
@@ -348,7 +354,9 @@ class GithubDetectUnusedRepos {
|
|||||||
// Set per_page
|
// Set per_page
|
||||||
args.per_page = 100;
|
args.per_page = 100;
|
||||||
|
|
||||||
let response: ResponseWithDataArrayAndMeta<TDataElement> = await method(args);
|
let response: ResponseWithDataArrayAndMeta<TDataElement> = await method(
|
||||||
|
args
|
||||||
|
);
|
||||||
|
|
||||||
// Concat all data
|
// Concat all data
|
||||||
let { data } = response;
|
let { data } = response;
|
||||||
@@ -372,13 +380,16 @@ class GithubDetectUnusedRepos {
|
|||||||
|
|
||||||
const branchesResponse: ResponseWithDataArray<
|
const branchesResponse: ResponseWithDataArray<
|
||||||
BranchFromGetBranches
|
BranchFromGetBranches
|
||||||
> = await this.paginate((tmpFirstParam: Octokit.ReposGetBranchesParams): Promise<
|
> = await this.paginate(
|
||||||
ResponseFromGetBranches
|
(
|
||||||
> => {
|
tmpFirstParam: Octokit.ReposGetBranchesParams
|
||||||
|
): Promise<ResponseFromGetBranches> => {
|
||||||
return (octokit.repos.getBranches(tmpFirstParam) as any) as Promise<
|
return (octokit.repos.getBranches(tmpFirstParam) as any) as Promise<
|
||||||
ResponseFromGetBranches
|
ResponseFromGetBranches
|
||||||
>;
|
>;
|
||||||
}, params);
|
},
|
||||||
|
params
|
||||||
|
);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
repoName,
|
repoName,
|
||||||
@@ -527,8 +538,6 @@ class GithubDetectUnusedRepos {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export function runMain(username: string = 'bendtherules') {
|
export function runMain(username: string = 'bendtherules') {
|
||||||
new GithubDetectUnusedRepos(username)
|
new GithubDetectUnusedRepos(username)
|
||||||
.fetchUnusedForkedRepos()
|
.fetchUnusedForkedRepos()
|
||||||
@@ -555,7 +564,7 @@ export function runMain(username: string = 'bendtherules') {
|
|||||||
// https://developer.github.com/v3/repos/commits/#compare-two-commits
|
// https://developer.github.com/v3/repos/commits/#compare-two-commits
|
||||||
// https://octokit.github.io/rest.js/#api-Repos-compareCommits
|
// https://octokit.github.io/rest.js/#api-Repos-compareCommits
|
||||||
//
|
//
|
||||||
// 4. If parent contains, then check if user is in contributor list (of either parent or forked repo) {Should not be present in either of them}
|
// 4. Then check if user is in contributor list (of either parent or forked repo) {Should not be present in either of them}
|
||||||
// https://developer.github.com/v3/repos/#list-contributors
|
// https://developer.github.com/v3/repos/#list-contributors
|
||||||
// https://octokit.github.io/rest.js/#api-Repos-getContributors
|
// https://octokit.github.io/rest.js/#api-Repos-getContributors
|
||||||
//
|
//
|
||||||
|
|||||||
Reference in New Issue
Block a user