{"record":{"id":"941586bc7bfdf66b","repo":"nektos/act","slug":"remote-s-exists-but-has-no-url","errorCode":null,"errorMessage":"remote '%s' exists but has no URL","messagePattern":"remote '(.+?)' exists but has no URL","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/common/git/git.go","lineNumber":195,"sourceCode":"func findGitRemoteURL(_ context.Context, file, remoteName string) (string, error) {\n\trepo, err := git.PlainOpenWithOptions(\n\t\tfile,\n\t\t&git.PlainOpenOptions{\n\t\t\tDetectDotGit:          true,\n\t\t\tEnableDotGitCommonDir: true,\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tremote, err := repo.Remote(remoteName)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif len(remote.Config().URLs) < 1 {\n\t\treturn \"\", fmt.Errorf(\"remote '%s' exists but has no URL\", remoteName)\n\t}\n\n\treturn remote.Config().URLs[0], nil\n}\n\nfunc findGitSlug(url string, githubInstance string) (string, string, error) {\n\tif matches := codeCommitHTTPRegex.FindStringSubmatch(url); matches != nil {\n\t\treturn \"CodeCommit\", matches[2], nil\n\t} else if matches := codeCommitSSHRegex.FindStringSubmatch(url); matches != nil {\n\t\treturn \"CodeCommit\", matches[2], nil\n\t} else if matches := githubHTTPRegex.FindStringSubmatch(url); matches != nil {\n\t\treturn \"GitHub\", fmt.Sprintf(\"%s/%s\", matches[1], matches[2]), nil\n\t} else if matches := githubSSHRegex.FindStringSubmatch(url); matches != nil {\n\t\treturn \"GitHub\", fmt.Sprintf(\"%s/%s\", matches[1], matches[2]), nil\n\t} else if githubInstance != \"github.com\" {\n\t\tgheHTTPRegex := regexp.MustCompile(fmt.Sprintf(`^https?://%s/(.+)/(.+?)(?:.git)?$`, githubInstance))\n\t\tgheSSHRegex := regexp.MustCompile(fmt.Sprintf(`%s[:/](.+)/(.+?)(?:.git)?$`, githubInstance))\n\t\tif matches := gheHTTPRegex.FindStringSubmatch(url); matches != nil {","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/nektos/act/blob/4f411281417e88660bea1c1a1749aa71ae0bd60f/pkg/common/git/git.go#L177-L213","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Set the URL: git remote set-url origin git@github.com:owner/repo.git","Or point act at a properly configured remote via the remote-name option (e.g. --github-remote-name upstream)","Inspect .git/config for a [remote] block with missing url lines and fix or remove it"],"exampleFix":"# before\n[remote \"origin\"]\n  fetch = +refs/heads/*:refs/remotes/origin/*\n  # url missing\n\n# after\n[remote \"origin\"]\n  url = https://github.com/owner/repo.git\n  fetch = +refs/heads/*:refs/remotes/origin/*","handlingStrategy":"validation","validationCode":"// verify the remote has a URL before act needs it\nout, err := exec.Command(\"git\", \"remote\", \"get-url\", \"origin\").Output()\nif err != nil || len(bytes.TrimSpace(out)) == 0 {\n    return fmt.Errorf(\"origin remote missing URL; fix with: git remote set-url origin <url>\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Clone via standard URLs so remotes are fully populated","Prefer 'git remote get-url' checks in setup scripts","Review .git/config after migration tooling touches it"],"tags":["git","remote","config","act"],"backgroundTag":null,"analyzedSha":"4f411281417e88660bea1c1a1749aa71ae0bd60f","analyzedAt":"2026-08-15T09:19:46.307Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}