From 4ac6be05a047b26f1e7f28728163ebe32b0c81ae Mon Sep 17 00:00:00 2001 From: Patrick Artounian <2541595+partounian@users.noreply.github.com> Date: Tue, 9 Jan 2024 18:03:15 -0800 Subject: [PATCH 1/2] allow skip_create_repos --- docker-build.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docker-build.sh b/docker-build.sh index 054f57c..b74ad81 100755 --- a/docker-build.sh +++ b/docker-build.sh @@ -237,6 +237,10 @@ _aws_repo_exists() { fi } +_skip_create_repos() { + [ "$INPUT_SKIP_CREATE_REPOS" = true ] +} + _create_aws_ecr_repos() { echo -e "\n[Action Step - AWS] Creating repositories (if needed)..." local main_repo stages_repo @@ -334,7 +338,7 @@ login_to_registry() { } create_repos() { - if ! _can_push; then + if ! _can_push || ! _skip_create_repos; then return fi if _is_aws_ecr; then @@ -405,7 +409,7 @@ _build_image_buildkit() { local cache_to if _can_push; then - cache_to="--cache-to mode=max,image-manifest=true,type=registry,ref=$cache_image" + cache_to="--cache-to mode=max,image-manifest=true,type=registry,compression=zstd,ref=$cache_image" fi _parse_extra_args From 36e419a98dd9d8716f8da40e6ab6ccc95f44315e Mon Sep 17 00:00:00 2001 From: Patrick Artounian <2541595+partounian@users.noreply.github.com> Date: Tue, 9 Jan 2024 19:13:50 -0800 Subject: [PATCH 2/2] Update action.yml with skip_create_repos --- action.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/action.yml b/action.yml index 5636329..c71c581 100644 --- a/action.yml +++ b/action.yml @@ -56,6 +56,10 @@ inputs: build_extra_args: description: "(Optional) Extra arguments to pass to docker build" required: false + skip_create_repos: + description: "(Optional) Skip looking for & creating AWS ECR repos" + required: false + default: false outputs: FULL_IMAGE_NAME: