Skip to content

fix : validate repository_url before extracting repo name in github.ts #498

@tmdeveloper007

Description

@tmdeveloper007

Summary of What Needs to be Done:
The code in src/lib/github.ts assumes repository_url always contains a properly formatted GitHub API URL. If the URL is malformed, split("/").pop() could return undefined or an empty string.

Changes that Need to be Made:

  • File: src/lib/github.ts (lines 113-118)
  • Add validation to ensure URL has expected structure before extracting repo name
  • Handle cases where URL might be malformed

Impact that it would Provide:

  • Prevents crashes from malformed URLs
  • Makes the code more robust against unexpected API responses

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions