nektos/act · error

remote '%s' exists but has no URL

Error message

remote '%s' exists but has no URL

What it means

findGitRemoteURL opens the repo, gets the named remote (default 'origin'), and requires at least one URL in its config. This error means the remote entry exists in .git/config but its url field(s) are empty — git allows creating a remote placeholder without a URL, but act cannot derive the repo slug from it.

Source

Thrown at pkg/common/git/git.go:195

func findGitRemoteURL(_ context.Context, file, remoteName string) (string, error) {
	repo, err := git.PlainOpenWithOptions(
		file,
		&git.PlainOpenOptions{
			DetectDotGit:          true,
			EnableDotGitCommonDir: true,
		},
	)
	if err != nil {
		return "", err
	}

	remote, err := repo.Remote(remoteName)
	if err != nil {
		return "", err
	}

	if len(remote.Config().URLs) < 1 {
		return "", fmt.Errorf("remote '%s' exists but has no URL", remoteName)
	}

	return remote.Config().URLs[0], nil
}

func findGitSlug(url string, githubInstance string) (string, string, error) {
	if matches := codeCommitHTTPRegex.FindStringSubmatch(url); matches != nil {
		return "CodeCommit", matches[2], nil
	} else if matches := codeCommitSSHRegex.FindStringSubmatch(url); matches != nil {
		return "CodeCommit", matches[2], nil
	} else if matches := githubHTTPRegex.FindStringSubmatch(url); matches != nil {
		return "GitHub", fmt.Sprintf("%s/%s", matches[1], matches[2]), nil
	} else if matches := githubSSHRegex.FindStringSubmatch(url); matches != nil {
		return "GitHub", fmt.Sprintf("%s/%s", matches[1], matches[2]), nil
	} else if githubInstance != "github.com" {
		gheHTTPRegex := regexp.MustCompile(fmt.Sprintf(`^https?://%s/(.+)/(.+?)(?:.git)?$`, githubInstance))
		gheSSHRegex := regexp.MustCompile(fmt.Sprintf(`%s[:/](.+)/(.+?)(?:.git)?$`, githubInstance))
		if matches := gheHTTPRegex.FindStringSubmatch(url); matches != nil {

View on GitHub (pinned to 4f41128141)

Solutions

  1. Set the URL: git remote set-url origin git@github.com:owner/repo.git
  2. Or point act at a properly configured remote via the remote-name option (e.g. --github-remote-name upstream)
  3. Inspect .git/config for a [remote] block with missing url lines and fix or remove it

Example fix

# before
[remote "origin"]
  fetch = +refs/heads/*:refs/remotes/origin/*
  # url missing

# after
[remote "origin"]
  url = https://github.com/owner/repo.git
  fetch = +refs/heads/*:refs/remotes/origin/*
Defensive patterns

Strategy: validation

Validate before calling

// verify the remote has a URL before act needs it
out, err := exec.Command("git", "remote", "get-url", "origin").Output()
if err != nil || len(bytes.TrimSpace(out)) == 0 {
    return fmt.Errorf("origin remote missing URL; fix with: git remote set-url origin <url>")
}

Prevention

When it happens

Trigger: FindGithubRepo/FindGitRef resolution when .git/config contains '[remote "origin"]' with no url lines, or url entries that are blank. Happens with hand-edited git configs, some repo-templating tools, or submodules configured oddly.

Common situations: git remote add origin with a typo'd/empty URL; migration scripts rewriting .git/config; mirrors that strip URLs; running act in repos cloned by tools that leave placeholder remotes.

Related errors


AI-assisted analysis of nektos/act@4f41128141 (2026-08-15). Data as JSON: /api/errors/941586bc7bfdf66b. Report an issue: GitHub.