fix: subpath actions via new artifact cache (#2170)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
parent
a6ec2c129a
commit
09d4b5d6ad
|
@ -125,20 +125,6 @@ func maybeCopyToActionDir(ctx context.Context, step actionStep, actionDir string
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if rc.Config != nil && rc.Config.ActionCache != nil {
|
|
||||||
raction := step.(*stepActionRemote)
|
|
||||||
ta, err := rc.Config.ActionCache.GetTarArchive(ctx, raction.cacheDir, raction.resolvedSha, "")
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
defer ta.Close()
|
|
||||||
return rc.JobContainer.CopyTarStream(ctx, containerActionDir, ta)
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := removeGitIgnore(ctx, actionDir); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
var containerActionDirCopy string
|
var containerActionDirCopy string
|
||||||
containerActionDirCopy = strings.TrimSuffix(containerActionDir, actionPath)
|
containerActionDirCopy = strings.TrimSuffix(containerActionDir, actionPath)
|
||||||
logger.Debug(containerActionDirCopy)
|
logger.Debug(containerActionDirCopy)
|
||||||
|
@ -146,6 +132,21 @@ func maybeCopyToActionDir(ctx context.Context, step actionStep, actionDir string
|
||||||
if !strings.HasSuffix(containerActionDirCopy, `/`) {
|
if !strings.HasSuffix(containerActionDirCopy, `/`) {
|
||||||
containerActionDirCopy += `/`
|
containerActionDirCopy += `/`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if rc.Config != nil && rc.Config.ActionCache != nil {
|
||||||
|
raction := step.(*stepActionRemote)
|
||||||
|
ta, err := rc.Config.ActionCache.GetTarArchive(ctx, raction.cacheDir, raction.resolvedSha, "")
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
defer ta.Close()
|
||||||
|
return rc.JobContainer.CopyTarStream(ctx, containerActionDirCopy, ta)
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := removeGitIgnore(ctx, actionDir); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
return rc.JobContainer.CopyDir(containerActionDirCopy, actionDir+"/", rc.Config.UseGitIgnore)(ctx)
|
return rc.JobContainer.CopyDir(containerActionDirCopy, actionDir+"/", rc.Config.UseGitIgnore)(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -75,7 +75,7 @@ func (sar *stepActionRemote) prepareActionExecutor() common.Executor {
|
||||||
|
|
||||||
remoteReader := func(ctx context.Context) actionYamlReader {
|
remoteReader := func(ctx context.Context) actionYamlReader {
|
||||||
return func(filename string) (io.Reader, io.Closer, error) {
|
return func(filename string) (io.Reader, io.Closer, error) {
|
||||||
spath := filename
|
spath := path.Join(sar.remoteAction.Path, filename)
|
||||||
for i := 0; i < maxSymlinkDepth; i++ {
|
for i := 0; i < maxSymlinkDepth; i++ {
|
||||||
tars, err := cache.GetTarArchive(ctx, sar.cacheDir, sar.resolvedSha, spath)
|
tars, err := cache.GetTarArchive(ctx, sar.cacheDir, sar.resolvedSha, spath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue