mirror of
https://github.com/RayLabsHQ/gitea-mirror.git
synced 2026-05-21 23:21:43 -05:00
[PR #255] [MERGED] fix: private GitHub mirror auth for migrate API #1611
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/RayLabsHQ/gitea-mirror/pull/255
Author: @arunavo4
Created: 3/27/2026
Status: ✅ Merged
Merged: 3/27/2026
Merged by: @arunavo4
Base:
main← Head:codex/fix-issue-254-private-mirror-auth📝 Commits (1)
df2d9a2fix private github mirror auth📊 Changes
3 files changed (+142 additions, -16 deletions)
View changed files
📝
src/lib/gitea.ts(+33 -16)➕
src/lib/utils/mirror-source-auth.test.ts(+63 -0)➕
src/lib/utils/mirror-source-auth.ts(+46 -0)📄 Description
Summary
auth_username: "oauth2"assumption with GitHub-compatible source credentials.Root Cause
A previous Forgejo 12 compatibility refactor removed credentials from clone URLs (correct), but switched private GitHub source auth to
auth_username + auth_tokenwithauth_username="oauth2".That username pattern is not reliably valid for GitHub HTTPS auth and caused private clone failures (
Invalid username or token,could not read Username ... terminal prompts disabled).What Changed
src/lib/gitea.tsmirrorGithubRepoToGitea: usebuildGithubSourceAuthPayload(...)for private sources.mirrorGitHubRepoToGiteaOrg: use the same helper for org mirror path.src/lib/utils/mirror-source-auth.tsauth_username,auth_password, andauth_tokenfrom GitHub config/repo context.src/lib/utils/mirror-source-auth.test.tsTesting
bun test src/lib/utils/mirror-source-auth.test.tsbun test src/lib/gitea.test.tsCloses #254
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.