feat: add flag to always run the checkout action (#1049)
act has a feature that skips the checkout action to do a remote checkout when a local checkout exists. in some cases, e.g. when running act in a CI, you always want to clone the repository.
This commit is contained in:
@@ -708,6 +708,10 @@ func setActionRuntimeVars(rc *RunContext, env map[string]string) {
|
||||
}
|
||||
|
||||
func (rc *RunContext) localCheckoutPath() (string, bool) {
|
||||
if rc.Config.NoSkipCheckout {
|
||||
return "", false
|
||||
}
|
||||
|
||||
ghContext := rc.getGithubContext()
|
||||
for _, step := range rc.Run.Job().Steps {
|
||||
if isLocalCheckout(ghContext, step) {
|
||||
|
@@ -48,6 +48,7 @@ type Config struct {
|
||||
ArtifactServerPath string // the path where the artifact server stores uploads
|
||||
ArtifactServerPort string // the port the artifact server binds to
|
||||
CompositeRestrictions *model.CompositeRestrictions // describes which features are available in composite actions
|
||||
NoSkipCheckout bool // do not skip actions/checkout
|
||||
}
|
||||
|
||||
// Resolves the equivalent host path inside the container
|
||||
|
@@ -92,7 +92,7 @@ func (sc *StepContext) Executor(ctx context.Context) common.Executor {
|
||||
remoteAction.URL = rc.Config.GitHubInstance
|
||||
|
||||
github := rc.getGithubContext()
|
||||
if remoteAction.IsCheckout() && isLocalCheckout(github, step) {
|
||||
if remoteAction.IsCheckout() && isLocalCheckout(github, step) && !rc.Config.NoSkipCheckout {
|
||||
return func(ctx context.Context) error {
|
||||
common.Logger(ctx).Debugf("Skipping local actions/checkout because workdir was already copied")
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user