diff --git a/cmd/root.go b/cmd/root.go index 920f50ef..0a93ac67 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -653,11 +653,13 @@ func newRunCommand(ctx context.Context, input *Input) func(*cobra.Command, []str ContainerNetworkMode: docker_container.NetworkMode(input.networkName), Parallel: input.parallel, } + actionCache := runner.GoGitActionCache{ + Path: config.ActionCacheDir, + } + config.ActionCache = &actionCache if input.actionOfflineMode { config.ActionCache = &runner.GoGitActionCacheOfflineMode{ - Parent: runner.GoGitActionCache{ - Path: config.ActionCacheDir, - }, + Parent: actionCache, } } if len(input.localRepository) > 0 { diff --git a/cmd/root_test.go b/cmd/root_test.go index 0d417434..cb010edb 100644 --- a/cmd/root_test.go +++ b/cmd/root_test.go @@ -3,6 +3,7 @@ package cmd import ( "context" "path" + "path/filepath" "testing" "github.com/stretchr/testify/assert" @@ -93,3 +94,16 @@ func TestWorkflowCall(t *testing.T) { })(rootCmd, []string{"workflow_call"}) assert.NoError(t, err) } + +func TestLocalRepositories(t *testing.T) { + wd, _ := filepath.Abs("../pkg/runner/testdata/") + rootCmd := createRootCommand(context.Background(), &Input{}, "") + err := newRunCommand(context.Background(), &Input{ + githubInstance: "github.com", + platforms: []string{"ubuntu-latest=node:16-buster-slim"}, + workdir: wd, + workflowsPath: "./remote-action-composite-action-ref-partial-override/push.yml", + localRepository: []string{"needs/override@main=" + wd + "/actions-environment-and-context-tests"}, + })(rootCmd, []string{"push"}) + assert.NoError(t, err) +} diff --git a/pkg/runner/testdata/remote-action-composite-action-ref-partial-override/push.yml b/pkg/runner/testdata/remote-action-composite-action-ref-partial-override/push.yml new file mode 100644 index 00000000..237e778b --- /dev/null +++ b/pkg/runner/testdata/remote-action-composite-action-ref-partial-override/push.yml @@ -0,0 +1,9 @@ +name: remote-action-composite-action-ref +on: push + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: nektos/act-test-actions/composite-assert-action-ref-action@main + - uses: needs/override/js@main \ No newline at end of file