File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import (
15
15
"strings"
16
16
"time"
17
17
18
+ "code.gitea.io/gitea/modules/git"
18
19
"code.gitea.io/gitea/modules/log"
19
20
base "code.gitea.io/gitea/modules/migration"
20
21
"code.gitea.io/gitea/modules/proxy"
@@ -291,10 +292,14 @@ func (g *GithubDownloaderV3) GetLabels() ([]*base.Label, error) {
291
292
}
292
293
293
294
func (g * GithubDownloaderV3 ) convertGithubRelease (rel * github.RepositoryRelease ) * base.Release {
295
+ // GitHub allows commitish to be a reference.
296
+ // In this case, we need to remove the prefix, i.e. convert "refs/heads/main" to "main".
297
+ targetCommitish := strings .TrimPrefix (rel .GetTargetCommitish (), git .BranchPrefix )
298
+
294
299
r := & base.Release {
295
300
Name : rel .GetName (),
296
301
TagName : rel .GetTagName (),
297
- TargetCommitish : rel . GetTargetCommitish () ,
302
+ TargetCommitish : targetCommitish ,
298
303
Draft : rel .GetDraft (),
299
304
Prerelease : rel .GetPrerelease (),
300
305
Created : rel .GetCreatedAt ().Time ,
You can’t perform that action at this time.
0 commit comments