Skip to content

Commit 9fcec2a

Browse files
committed
feat: add codeberg SCM
Codeberg SCM follows GitHub structures AND also exposes the go meta head. In order to avoid unnecessary network calls, just implement the corresponding regex Signed-off-by: grouville <[email protected]>
1 parent abaf5ea commit 9fcec2a

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

vcs/vcs.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,15 @@ var vcsPaths = []*vcsPath{
585585
check: noVCSSuffix,
586586
},
587587

588+
// Codeberg
589+
{
590+
prefix: "codeberg.org/",
591+
re: `^(?P<root>codeberg\.org/[A-Za-z0-9_.\-]+/[A-Za-z0-9_.\-]+)(/[\p{L}0-9_.\-]+)*$`,
592+
vcs: "git",
593+
repo: "https://{root}",
594+
check: noVCSSuffix,
595+
},
596+
588597
// Bitbucket
589598
{
590599
prefix: "bitbucket.org/",

vcs/vcs_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,13 @@ func TestRepoRootForImportPath(t *testing.T) {
109109
Repo: "https://bitbucket.org/workspace/pkgname",
110110
},
111111
},
112+
{
113+
"codeberg.org/workspace/pkgname/subdir",
114+
&RepoRoot{
115+
VCS: vcsGit,
116+
Repo: "https://codeberg.org/workspace/pkgname",
117+
},
118+
},
112119
}
113120

114121
for _, test := range tests {

0 commit comments

Comments
 (0)