From 0c0fd333f30ec86dc60252a112c14403e5aba729 Mon Sep 17 00:00:00 2001
From: Michael Kriese <michael.kriese@visualon.de>
Date: Sun, 3 Nov 2024 14:47:05 +0100
Subject: [PATCH] fix: support `www.github.com` for migrations

(cherry picked from commit 284ffe4e00e822db50bf22269da80f8dc39fe669)
---
 services/migrations/github.go | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/services/migrations/github.go b/services/migrations/github.go
index 44553e1802..54d38596e1 100644
--- a/services/migrations/github.go
+++ b/services/migrations/github.go
@@ -45,6 +45,11 @@ func (f *GithubDownloaderV3Factory) New(ctx context.Context, opts base.MigrateOp
 		return nil, err
 	}
 
+	// some users are using the github redirect url for migration
+	if u.Host == "www.github.com" {
+		u.Host = "github.com"
+	}
+
 	baseURL := u.Scheme + "://" + u.Host
 	fields := strings.Split(u.Path, "/")
 	oldOwner := fields[1]