diff --git a/pkg/runner/step_context.go b/pkg/runner/step_context.go index 372c594..5d64241 100644 --- a/pkg/runner/step_context.go +++ b/pkg/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/pkg/runner/testdata/local-action-dockerfile/push.yml b/pkg/runner/testdata/local-action-dockerfile/push.yml index 06f9f4c..3a76107 100644 --- a/pkg/runner/testdata/local-action-dockerfile/push.yml +++ b/pkg/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/pkg/runner/testdata/localdockerimagetest_/Dockerfile b/pkg/runner/testdata/localdockerimagetest_/Dockerfile new file mode 100644 index 0000000..94798c1 --- /dev/null +++ b/pkg/runner/testdata/localdockerimagetest_/Dockerfile @@ -0,0 +1,2 @@ +FROM ubuntu:latest +CMD echo Hello