mirror of
https://github.com/anotherhadi/blog.git
synced 2026-05-20 05:32:32 +02:00
skip some repos
Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
This commit is contained in:
@@ -29,6 +29,7 @@ const GITEA_BASE = "https://git.hadi.icu";
|
|||||||
const GITEA_USER = "anotherhadi";
|
const GITEA_USER = "anotherhadi";
|
||||||
const GITHUB_USER = "anotherhadi";
|
const GITHUB_USER = "anotherhadi";
|
||||||
const GITLAB_USER = "anotherhadi_mirror";
|
const GITLAB_USER = "anotherhadi_mirror";
|
||||||
|
const SKIP_REPOS = ["anotherhadi"];
|
||||||
|
|
||||||
async function checkMirrors(repoName: string): Promise<RepoMirrors> {
|
async function checkMirrors(repoName: string): Promise<RepoMirrors> {
|
||||||
const mirrors: RepoMirrors = {};
|
const mirrors: RepoMirrors = {};
|
||||||
@@ -56,8 +57,13 @@ export async function fetchGiteaRepos(): Promise<GiteaRepoWithMirrors[]> {
|
|||||||
if (!res.ok) throw new Error(`Gitea API: ${res.status}`);
|
if (!res.ok) throw new Error(`Gitea API: ${res.status}`);
|
||||||
|
|
||||||
const repos: GiteaRepo[] = await res.json();
|
const repos: GiteaRepo[] = await res.json();
|
||||||
|
|
||||||
const filtered = repos
|
const filtered = repos
|
||||||
.filter((r) => !r.fork && !r.private)
|
.filter((r) =>
|
||||||
|
!r.fork &&
|
||||||
|
!r.private &&
|
||||||
|
!SKIP_REPOS.includes(r.name)
|
||||||
|
)
|
||||||
.sort(
|
.sort(
|
||||||
(a, b) =>
|
(a, b) =>
|
||||||
new Date(b.updated_at).getTime() - new Date(a.updated_at).getTime()
|
new Date(b.updated_at).getTime() - new Date(a.updated_at).getTime()
|
||||||
|
|||||||
Reference in New Issue
Block a user