Fix docker: invalid reference format (#767)
* Fix local Docker actions: invalid reference format * Create Dockerfile * Create Dockerfile * Update push.yml * Revert "Create Dockerfile" This reverts commit 9d1dbbc2c7fdf52963e55feb4148ac2b14d639d0. * Fix lint * fix: re-use image that is already present in repo ubuntu:latest would pull unnecessary blobs from registry and count toward API limit * fix: revert change reverting due to issue in image deletion that will have to be investigated separately Co-authored-by: Ryan <me@hackerc.at>
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user