mirror of
https://github.com/RayLabsHQ/gitea-mirror.git
synced 2026-07-22 11:38:40 -05:00
[PR #320] [MERGED] feat(github): add skipPersonalRepos toggle to mirror only org repos #6604
Reference in New Issue
Block a user
📋 Pull Request Information
Original PR: https://github.com/RayLabsHQ/gitea-mirror/pull/320
Author: @arunavo4
Created: 6/12/2026
Status: ✅ Merged
Merged: 6/13/2026
Merged by: @arunavo4
Base:
main← Head:feat/304-skip-personal-repos📝 Commits (1)
33b5a46feat(github): add skipPersonalRepos toggle to mirror only org repos (#304)📊 Changes
9 files changed (+150 additions, -11 deletions)
View changed files
📝
docs/ENVIRONMENT_VARIABLES.md(+1 -1)📝
src/components/config/GitHubMirrorSettings.tsx(+20 -0)📝
src/lib/db/schema.ts(+3 -0)📝
src/lib/env-config-loader.ts(+2 -0)📝
src/lib/github-affiliation.test.ts(+75 -9)📝
src/lib/github.ts(+12 -1)📝
src/lib/utils/config-mapper.test.ts(+34 -0)📝
src/lib/utils/config-mapper.ts(+2 -0)📝
src/types/config.ts(+1 -0)📄 Description
Fixes #304 (the "disable personal-repo import" half; mirroring arbitrary external user accounts is tracked separately, see #221).
Problem
Repo discovery always imports the authenticated user's personal repos (the
owneraffiliation is part of every discovery call), so users who only want manually-added external orgs had to manually ignore their own repos after every import cycle.Change
githubConfig.skipPersonalRepos(defaultfalse, no migration needed — JSON blob config). When enabled,getGithubRepositoriesdrops repos owned by the authenticated user (owner.loginmatches the configured username ANDowner.type === "User"), keeping org repos and collaborator repos. Starred-repo discovery is unaffected.ONLY_MIRROR_ORGSenv var was previously parsed and silently dropped (dead); it now maps toskipPersonalRepos: true. Docs updated.include/excludeconfig arrays are now annotated as reserved (they have never been read by any code path).Testing
10 new unit tests (filter behavior incl. collaborator/org preservation and empty-login safety, config-mapper round-trip, env mapping). Full suite green.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.