act icon indicating copy to clipboard operation
act copied to clipboard

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

Open stephenwithav opened this issue 1 year ago • 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. :)

https://github.com/nektos/act/blob/ccd28e7939cf3feed230944cfc3a0498b98bddab/pkg/model/github_context.go#L172

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]
}

stephenwithav avatar Oct 19 '24 21:10 stephenwithav

This used to work but was removed.

https://github.com/nektos/act/compare/9085c833bf2b68e90c022e70912b3c0c4499bdbc..ace4cd47c7f099864866b1f60e064fecde7f36ea#diff-c057d66dc9657d8428e290c69871596e2b567bb8fecad62a99cab54398131a84L679

stephenwithav avatar Oct 19 '24 21:10 stephenwithav

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

stephenwithav avatar Oct 19 '24 21:10 stephenwithav

This bypasses the remote warning introduced in #2169

stephenwithav avatar Oct 19 '24 23:10 stephenwithav

Is there any update to this? My script still works but this warning bothers me because it is cluttering the stdout logs. In that PR 2169, the merging is blocked. @stephenwithav

maximillianus avatar Jan 23 '25 10:01 maximillianus

None that I'm aware of. @ChristopherHX?

stephenwithav avatar Jan 25 '25 01:01 stephenwithav

None from my side as well, except permissions.

Does not look differently for my account. @stephenwithav

Image

I'm not that far away from hard forking to actions-oss, I cannot do anything without cplee / inactive maintainers. Hard forking also means a huge regression of installation methods / github stars / visibility.

two approval rule is required to let mergify do the merge, that I'm not permitted to perform myself.

My primary focus left act this year, some PR's changed to closed from my side and no new changes from this month.

ChristopherHX avatar Jan 25 '25 11:01 ChristopherHX

I'll be an active contributor if you fork, @ChristopherHX. If nektos/act is no longer actively maintained, it may be needed.

I had considered rewriting it from the ground up, but faced the same hard fork concerns. Refactoring a fork may be a better option.

stephenwithav avatar Jan 25 '25 16:01 stephenwithav

Just to add that it's not when no remote exist, but when no remote named "origin" exist. I had 2 remote named gitlab and github and encounter this issue

JasonMarechal25 avatar Feb 07 '25 15:02 JasonMarechal25