This is an automated email from the ASF dual-hosted git repository.

sbp pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-release.git


The following commit(s) were added to refs/heads/main by this push:
     new e7b9fef  Extract information from GitHub user pages URLs
e7b9fef is described below

commit e7b9feff92caa716290730b04feabf589b994349
Author: Sean B. Palmer <[email protected]>
AuthorDate: Fri Aug 29 16:42:47 2025 +0100

    Extract information from GitHub user pages URLs
---
 atr/sbomtool.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/atr/sbomtool.py b/atr/sbomtool.py
index 1796026..efb0a35 100644
--- a/atr/sbomtool.py
+++ b/atr/sbomtool.py
@@ -25,6 +25,7 @@ import subprocess
 import sys
 import tempfile
 import urllib.error
+import urllib.parse
 import urllib.request
 from typing import Annotated, Any, Literal
 
@@ -325,6 +326,12 @@ def assemble_component_supplier(doc: yyjson.Document, 
patch: Patch, index: int)
             if url.startswith("https://github.com/";):
                 github_user = 
url.removeprefix("https://github.com/";).split("/", 1)[0]
                 return make_supplier_op(f"@github/{github_user}", 
f"https://github.com/{github_user}";)
+            domain = urllib.parse.urlparse(url).netloc
+            if domain.endswith(".github.io"):
+                github_user = domain.removesuffix(".github.io")
+                return make_supplier_op(f"@github/{github_user}", 
f"https://github.com/{github_user}";)
+            if ("//" in url) and (url.count("/") == 2):
+                url += "/"
             return make_supplier_op(url, url)
 
         cache: dict[str, Any] = maven_cache_read()


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to