MCPcopy
hub / github.com/nektos/act / CopyDir

Method CopyDir

pkg/container/docker_run.go:126–138  ·  view source on GitHub ↗
(destPath string, srcPath string, useGitIgnore bool)

Source from the content-addressed store, hash-verified

124}
125
126func (cr *containerReference) CopyDir(destPath string, srcPath string, useGitIgnore bool) common.Executor {
127 return common.NewPipelineExecutor(
128 common.NewInfoExecutor("%sdocker cp src=%s dst=%s", logPrefix, srcPath, destPath),
129 cr.copyDir(destPath, srcPath, useGitIgnore),
130 func(ctx context.Context) error {
131 // If this fails, then folders have wrong permissions on non root container
132 if cr.UID != 0 || cr.GID != 0 {
133 _ = cr.Exec([]string{"chown", "-R", fmt.Sprintf("%d:%d", cr.UID, cr.GID), destPath}, nil, "0", "")(ctx)
134 }
135 return nil
136 },
137 ).IfNot(common.Dryrun)
138}
139
140func (cr *containerReference) GetContainerArchive(ctx context.Context, srcPath string) (io.ReadCloser, error) {
141 if common.Dryrun(ctx) {

Callers

nothing calls this directly

Calls 5

copyDirMethod · 0.95
ExecMethod · 0.95
NewPipelineExecutorFunction · 0.92
NewInfoExecutorFunction · 0.92
IfNotMethod · 0.80

Tested by

no test coverage detected