diff --git a/act/runner/step_context.go b/act/runner/step_context.go index 372c594a..5d642415 100644 --- a/act/runner/step_context.go +++ b/act/runner/step_context.go @@ -506,7 +506,8 @@ func (sc *StepContext) execAsDocker(ctx context.Context, action *model.Action, a if strings.HasPrefix(action.Runs.Image, "docker://") { image = strings.TrimPrefix(action.Runs.Image, "docker://") } else { - image = fmt.Sprintf("%s:%s", regexp.MustCompile("[^a-zA-Z0-9]").ReplaceAllString(actionName, "-"), "latest") + // "-dockeraction" enshures that "./", "./test " won't get converted to "act-:latest", "act-test-:latest" which are invalid docker image names + image = fmt.Sprintf("%s-dockeraction:%s", regexp.MustCompile("[^a-zA-Z0-9]").ReplaceAllString(actionName, "-"), "latest") image = fmt.Sprintf("act-%s", strings.TrimLeft(image, "-")) image = strings.ToLower(image) basedir := actionLocation diff --git a/act/runner/testdata/local-action-dockerfile/push.yml b/act/runner/testdata/local-action-dockerfile/push.yml index 06f9f4c7..3a76107b 100644 --- a/act/runner/testdata/local-action-dockerfile/push.yml +++ b/act/runner/testdata/local-action-dockerfile/push.yml @@ -9,3 +9,4 @@ jobs: - uses: ./actions/docker-local with: who-to-greet: 'Mona the Octocat' + - uses: ./localdockerimagetest_ diff --git a/act/runner/testdata/localdockerimagetest_/Dockerfile b/act/runner/testdata/localdockerimagetest_/Dockerfile new file mode 100644 index 00000000..94798c1d --- /dev/null +++ b/act/runner/testdata/localdockerimagetest_/Dockerfile @@ -0,0 +1,2 @@ +FROM ubuntu:latest +CMD echo Hello