Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions pkg/runner/action.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package runner

import (
"archive/tar"
"context"
"embed"
"errors"
Expand Down Expand Up @@ -133,7 +134,22 @@ func maybeCopyToActionDir(ctx context.Context, step actionStep, actionPath strin
containerActionDirCopy += `/`
}

content, err := rc.JobContainer.GetContainerArchive(ctx, containerActionDirCopy)
if err == nil {
defer content.Close()
if _, err := tar.NewReader(content).Next(); err == nil {
logger.Debugf("Skipping copy because actiondir has been already copied")
return nil
}
}

raction := step.(*stepActionRemote)
defer func() {
raction.copyDone = true
}()
if raction.copyDone {
return nil
}
ta, err := rc.getActionCache().GetTarArchive(ctx, raction.cacheDir, raction.resolvedSha, "")
if err != nil {
return err
Expand Down
1 change: 1 addition & 0 deletions pkg/runner/step_action_remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ type stepActionRemote struct {
remoteAction *remoteAction
cacheDir string
resolvedSha string
copyDone bool
}

func (sar *stepActionRemote) prepareActionExecutor() common.Executor {
Expand Down
Loading