* fix #128: guard against empty actionName when 'uses: ./' * fix #129 - force image name to be lowercase
This commit is contained in:
parent
1f9f3b826e
commit
c32a87c6dc
2 changed files with 7 additions and 2 deletions
|
@ -238,7 +238,7 @@ func NewGitCloneExecutor(input NewGitCloneExecutorInput) Executor {
|
||||||
Force: true,
|
Force: true,
|
||||||
})
|
})
|
||||||
if err != nil && err.Error() != "already up-to-date" {
|
if err != nil && err.Error() != "already up-to-date" {
|
||||||
logger.Errorf("Unable to pull %s: %v", refName, err)
|
logger.Debugf("Unable to pull %s: %v", refName, err)
|
||||||
}
|
}
|
||||||
logger.Debugf("Cloned %s to %s", input.URL, input.Dir)
|
logger.Debugf("Cloned %s to %s", input.URL, input.Dir)
|
||||||
|
|
||||||
|
|
|
@ -248,7 +248,11 @@ func (sc *StepContext) runAction(actionDir string, actionPath string) common.Exe
|
||||||
containerActionDir = "/actions"
|
containerActionDir = "/actions"
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Debugf("actionDir=%s Workdir=%s ActionCacheDir=%s actionName=%s containerActionDir=%s", actionDir, rc.Config.Workdir, rc.ActionCacheDir(), actionName, containerActionDir)
|
if actionName == "" {
|
||||||
|
actionName = filepath.Base(actionDir)
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Debugf("type=%v actionDir=%s Workdir=%s ActionCacheDir=%s actionName=%s containerActionDir=%s", step.Type(), actionDir, rc.Config.Workdir, rc.ActionCacheDir(), actionName, containerActionDir)
|
||||||
|
|
||||||
switch action.Runs.Using {
|
switch action.Runs.Using {
|
||||||
case model.ActionRunsUsingNode12:
|
case model.ActionRunsUsingNode12:
|
||||||
|
@ -267,6 +271,7 @@ func (sc *StepContext) runAction(actionDir string, actionPath string) common.Exe
|
||||||
} else {
|
} else {
|
||||||
image = fmt.Sprintf("%s:%s", regexp.MustCompile("[^a-zA-Z0-9]").ReplaceAllString(actionName, "-"), "latest")
|
image = fmt.Sprintf("%s:%s", regexp.MustCompile("[^a-zA-Z0-9]").ReplaceAllString(actionName, "-"), "latest")
|
||||||
image = fmt.Sprintf("act-%s", strings.TrimLeft(image, "-"))
|
image = fmt.Sprintf("act-%s", strings.TrimLeft(image, "-"))
|
||||||
|
image = strings.ToLower(image)
|
||||||
contextDir := filepath.Join(actionDir, actionPath, action.Runs.Main)
|
contextDir := filepath.Join(actionDir, actionPath, action.Runs.Main)
|
||||||
prepImage = container.NewDockerBuildExecutor(container.NewDockerBuildExecutorInput{
|
prepImage = container.NewDockerBuildExecutor(container.NewDockerBuildExecutorInput{
|
||||||
ContextDir: contextDir,
|
ContextDir: contextDir,
|
||||||
|
|
Loading…
Add table
Reference in a new issue