Skip to content

Fix Forgejo clone authentication and SSH URL support#204

Merged
amitsaha merged 1 commit into
amitsaha:masterfrom
rdowavic:fix/forgejo-clone-auth
Feb 25, 2026
Merged

Fix Forgejo clone authentication and SSH URL support#204
amitsaha merged 1 commit into
amitsaha:masterfrom
rdowavic:fix/forgejo-clone-auth

Conversation

@rdowavic

Copy link
Copy Markdown
Contributor

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
@amitsaha amitsaha merged commit e75b127 into amitsaha:master Feb 25, 2026
6 checks passed
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

2 participants