nikivdev/code · error

Invalid GitHub SSH URL: {}

Error message

Invalid GitHub SSH URL: {}

What it means

Error "Invalid GitHub SSH URL: {}" thrown in nikivdev/code.

Source

Thrown at src/publish.rs:28

use crossterm::event::{self, Event as CEvent, KeyCode};
use crossterm::terminal::{disable_raw_mode, enable_raw_mode};
use reqwest::blocking::Client;
use serde::Serialize;

use crate::cli::{PublishAction, PublishCommand, PublishOpts};
use crate::config;
use crate::vcs;

fn parse_github_repo(url: &str) -> Result<(String, String, String)> {
    let trimmed = url.trim().trim_end_matches('/');
    if trimmed.is_empty() {
        bail!("GitHub URL is empty");
    }

    if let Some(rest) = trimmed.strip_prefix("git@github.com:") {
        let rest = rest.trim_end_matches(".git");
        let Some((owner, repo)) = rest.split_once('/') else {
            bail!("Invalid GitHub SSH URL: {}", url);
        };
        return Ok((
            owner.to_string(),
            repo.to_string(),
            format!("git@github.com:{}/{}.git", owner, repo),
        ));
    }

    if let Some(rest) = trimmed.strip_prefix("https://github.com/") {
        let rest = rest.trim_end_matches(".git");
        let Some((owner, repo)) = rest.split_once('/') else {
            bail!("Invalid GitHub HTTPS URL: {}", url);
        };
        return Ok((
            owner.to_string(),
            repo.to_string(),
            format!("git@github.com:{}/{}.git", owner, repo),
        ));

View on GitHub (pinned to a747e741ae)

When it happens

Trigger: Thrown at src/publish.rs:28 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of nikivdev/code@a747e741ae (2026-09-01). Data as JSON: /api/errors/8ee6adac8871550f. Report an issue: GitHub.