Skip to content

Utils Function for Extracting Repo Name has Bug #9

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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