Skip to content

Commit 5311304

Browse files
authored
feat: only allow group urls when importing publishers
1 parent 50ee1bb commit 5311304

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

publisher-importer/process-swiss-index.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,16 @@ async function processSwissIndex() {
2727

2828
// Process each URL
2929
const requestPromises = urls.map((url) => {
30-
// Determine if this is a group URL or a repository URL
31-
// Group URLs: https://github.com/groupname
32-
// Repo URLs: https://github.com/groupname/reponame
33-
const isGroupUrl = /^https:\/\/github\.com\/[^\/]+\/?$/.test(url);
30+
// For the time being, we only allow group URLs.
31+
// As GitLabs allows subgroups, it is not possible to tell whether a URL is for a group or a repository.
32+
// Group URLs: https://github.com/group or https://gitlab.com/group/subgroup
33+
// Repo URLs: https://github.com/group/repo
34+
// const isGroupUrl = /^https:\/\/(?:github|gitlab)\.com\/[^\/]+\/?$/.test(url);
3435
const postData = JSON.stringify({
3536
codeHosting: [
3637
{
3738
url: url,
38-
group: isGroupUrl,
39+
group: true,
3940
},
4041
],
4142
description: `Swiss Federal Organization: ${url}`,

0 commit comments

Comments
 (0)