parse_github_reference

Function parse_github_reference 

Source
pub fn parse_github_reference(
    kind: ReferenceKind,
    input: &str,
    repo_context: Option<&str>,
) -> Result<(String, String, u64)>
Expand description

Parses a GitHub reference (issue or PR) in multiple formats.

Supports:

  • Full URL: https://github.com/owner/repo/issues/123 or https://github.com/owner/repo/pull/123
  • Short form: owner/repo#123
  • Bare number: 123 (requires repo_context)

§Arguments

  • kind - The type of reference (Issue or Pull)
  • input - The reference to parse
  • repo_context - Optional repository context for bare numbers (e.g., “owner/repo”)

§Errors

Returns an error if the format is invalid or bare number is used without context.