nektos/act · error

GoGitActionCache failed to create remote %s with ref %s at %

Error message

GoGitActionCache failed to create remote %s with ref %s at %s: %w

What it means

Fetch then calls gogitrepo.CreateRemoteAnonymous with a RemoteConfig named 'anonymous' and URLs: [url]. This error wraps a go-git error creating that anonymous remote — typically an invalid repository URL (bad scheme, unsupported protocol like ssh without support compiled in) or an invalid remote configuration.

Source

Thrown at pkg/runner/action_cache.go:69

		return "", fmt.Errorf("GoGitActionCache failed to generate random tmp branch %s with ref %s at %s: %w", url, ref, gitPath, err)
	}
	branchName := hex.EncodeToString(tmpBranch)

	var auth transport.AuthMethod
	if token != "" {
		auth = &http.BasicAuth{
			Username: "token",
			Password: token,
		}
	}
	remote, err := gogitrepo.CreateRemoteAnonymous(&config.RemoteConfig{
		Name: "anonymous",
		URLs: []string{
			url,
		},
	})
	if err != nil {
		return "", fmt.Errorf("GoGitActionCache failed to create remote %s with ref %s at %s: %w", url, ref, gitPath, err)
	}
	defer func() {
		_ = gogitrepo.DeleteBranch(branchName)
	}()
	if err := remote.FetchContext(ctx, &git.FetchOptions{
		RefSpecs: []config.RefSpec{
			config.RefSpec(ref + ":" + branchName),
		},
		Auth:  auth,
		Force: true,
		Depth: 1,
	}); err != nil {
		return "", fmt.Errorf("GoGitActionCache failed to fetch %s with ref %s at %s: %w", url, ref, gitPath, err)
	}
	hash, err := gogitrepo.ResolveRevision(plumbing.Revision(branchName))
	if err != nil {
		return "", fmt.Errorf("GoGitActionCache failed to resolve sha %s with ref %s at %s: %w", url, ref, gitPath, err)
	}

View on GitHub (pinned to 4f41128141)

Solutions

  1. Check the action/workflow 'uses:' string is well-formed: {owner}/{repo}[/{path}]@{ref} over HTTPS.
  2. If using GitHub Enterprise, verify GITHUB_SERVER_URL/GITHUB_API_URL env vars point to a valid HTTPS endpoint.
  3. Clear the bare cache repo directory named in the error in case its config is corrupt: rm -rf <gitPath>.
  4. Update go-git/act — older versions reject URL forms that newer ones accept.

Example fix

# before (workflow)
uses: git@github.com:org/repo/.github/actions/my-action@v1

# after
uses: org/repo/.github/actions/my-action@v1
Defensive patterns

Strategy: validation

Validate before calling

# sanity-check that the action URL go-git will use is parseable
git ls-remote https://github.com/{owner}/{repo} HEAD >/dev/null && echo url-ok

Prevention

When it happens

Trigger: The 'uses:' reference resolves to a URL go-git cannot parse as a remote: malformed URL, unsupported scheme (e.g. git@... SSH URL where only https is expected), or a URL with invalid characters. Also fires if the repository config in the bare cache repo is corrupt.

Common situations: Workflow 'uses: org/repo/path@ref' that produces a bad URL due to a typo; enterprise GitHub with a custom URL template (--env GITHUB_SERVER_URL / GITHUB_API_URL misconfigured); action referenced via an SSH-style URL.

Related errors


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