From f36895c4bab211abe35c606df9b58914fcac582d Mon Sep 17 00:00:00 2001 From: hlts2 Date: Mon, 26 Feb 2024 17:20:35 +0900 Subject: [PATCH] fix: build target condition Signed-off-by: hlts2 --- .github/actions/docker-build/action.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/actions/docker-build/action.yaml b/.github/actions/docker-build/action.yaml index 556a0552b6..ffd4d0757d 100644 --- a/.github/actions/docker-build/action.yaml +++ b/.github/actions/docker-build/action.yaml @@ -98,9 +98,10 @@ runs: extra_tags="-t ${IMAGE_NAME}:${PRIMARY_TAG} -t ${ALTER_IMAGE_NAME}:${PRIMARY_TAG}" else for tag in ${TAGS}; do - if ! [[ "${tag}" = "nightly" ]] || ! [[ "$GITHUB_BASE_REF" =~ ^release/v([0-9]+)\.([0-9]+)$ ]]; then - extra_tags="${extra_tags} -t ${IMAGE_NAME}:${tag} -t ${ALTER_IMAGE_NAME}:${tag}" + if [[ "${tag}" = "nightly" ]] && (! [[ "$GITHUB_REF" =~ ^refs/heads/main$ ]] || ! [[ "$GITHUB_REF" =~ ^refs/heads/master$ ]]); then + continue fi + extra_tags="${extra_tags} -t ${IMAGE_NAME}:${tag} -t ${ALTER_IMAGE_NAME}:${tag}" done fi echo "EXTRA_TAGS is determined: ${extra_tags}"