with actions repo
This commit is contained in:
@@ -47,18 +47,13 @@ func (ac *ActionCreator) Prepare(ctx context.Context, ops *ActionCreatorOps) (*A
|
||||
return nil, err
|
||||
}
|
||||
|
||||
cloneCtx, _ := context.WithTimeout(ctx, time.Second*5)
|
||||
repo, err := ac.git.Clone(cloneCtx, area, ops.RepositoryUrl)
|
||||
cloneCtx, _ := context.WithTimeout(ctx, time.Second*10)
|
||||
_, err = ac.git.CloneBranch(cloneCtx, area, ops.RepositoryUrl, ops.Branch)
|
||||
if err != nil {
|
||||
ac.logger.Error("could not clone repo", zap.Error(err))
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err = ac.git.Checkout(ctx, repo, ops.Branch)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
executorUrl := path.Join(area.Path, ops.Path)
|
||||
if _, err = os.Stat(executorUrl); os.IsNotExist(err) {
|
||||
return nil, fmt.Errorf("path is invalid: %s", ops.Path)
|
||||
@@ -74,6 +69,8 @@ func (ac *ActionCreator) Prepare(ctx context.Context, ops *ActionCreatorOps) (*A
|
||||
return nil, err
|
||||
}
|
||||
|
||||
ac.logger.Debug("Action creator done")
|
||||
|
||||
return &Action{
|
||||
Schema: krakenSchema,
|
||||
}, nil
|
||||
|
Reference in New Issue
Block a user