Skip to content

Utils Function for Extracting Repo Name has Bug #9

@fullerzz

Description

@fullerzz

def extract_repo_name_from_html_url(html_url: str) -> str:
# Example: https://github.com/leptos-rs/leptos/releases/tag/v0.7.2
url_parts = html_url.split("/")
return url_parts[-4]

The linked function has a bug for edge cases where the tag name contains a /.

Example

Tag name @sveltejs/kit@2.15.1 with url
https://github.com/sveltejs/kit/releases/tag/%40sveltejs%2Fkit%402.15.1 results in repo name of releases.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions