nektos/act

act shouldn't complain when there's no remote repo

Opened this issue · 3 comments

Act version

5a1e0d9, built with my PR

Feature description

act complains when there's no remote repo.

Sometimes, a dev just wants to test ideas locally before creating a remote repo. :)

common.Logger(ctx).Warningf("unable to get git repo (githubInstance: %v; remoteName: %v, repoPath: %v): %v", githubInstance, remoteName, repoPath, err)

func (ghc *GithubContext) SetRepositoryAndOwner(ctx context.Context, githubInstance string, remoteName string, repoPath string) {
	if ghc.Repository == "" {
		repo, err := git.FindGithubRepo(ctx, repoPath, githubInstance, remoteName)
		if err != nil {
			common.Logger(ctx).Warningf("unable to get git repo (githubInstance: %v; remoteName: %v, repoPath: %v): %v", githubInstance, remoteName, repoPath, err)
			return
		}
		ghc.Repository = repo
	}
	ghc.RepositoryOwner = strings.Split(ghc.Repository, "/")[0]
}

The main issue is getGithubContext is called in multiple places, so the error repeats over and over.

This bypasses the remote warning introduced in #2169