Skip to content

Comments

Fix Forgejo clone authentication and SSH URL support#204

Open
rdowavic wants to merge 1 commit intoamitsaha:masterfrom
rdowavic:fix/forgejo-clone-auth
Open

Fix Forgejo clone authentication and SSH URL support#204
rdowavic wants to merge 1 commit intoamitsaha:masterfrom
rdowavic:fix/forgejo-clone-auth

Conversation

@rdowavic
Copy link

Summary

  • Add Forgejo case to getUsername() so HTTPS clone URLs include credentials for private repos
  • Set gitHostToken in newForgejoClient() so the token is available during HTTPS cloning
  • Use getCloneURL() in forgejo.go instead of hardcoding repo.CloneURL, so SSH URLs are used when -use-https-clone is not set
  • Fix test mock data to include both clone_url and ssh_url fields

Fixes #193

Test plan

  • go test ./... passes
  • Tested against local Forgejo instance (Docker) with both public and private repos
  • HTTPS cloning of private repos now works with -use-https-clone
  • SSH URLs are correctly used when -use-https-clone is not set

- Add Forgejo case to getUsername() in helpers.go so credentials are
  embedded in HTTPS clone URLs for private repos
- Set gitHostToken in newForgejoClient() so the token is available
  for HTTPS cloning
- Use getCloneURL() in forgejo.go instead of hardcoding repo.CloneURL,
  so SSH URLs are used when -use-https-clone is not set
- Fix test mock data to include both clone_url and ssh_url fields

Fixes amitsaha#193
@rdowavic rdowavic marked this pull request as draft February 22, 2026 11:48
@rdowavic rdowavic marked this pull request as ready for review February 22, 2026 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for Forgejo self-hosted instance

1 participant