From 91a460448282ba9dd41543e20c98817f01b6df05 Mon Sep 17 00:00:00 2001 From: Nikita Belonogov Date: Mon, 23 Dec 2024 22:07:33 +0400 Subject: [PATCH] ci: PLT-607: Remove dangling hyphen in release name --- .github/workflows/argocd-destroy.yml | 2 +- .github/workflows/argocd-scaledown.yml | 2 +- .github/workflows/docker-build.yml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/argocd-destroy.yml b/.github/workflows/argocd-destroy.yml index e08a1c22..9736bb55 100644 --- a/.github/workflows/argocd-destroy.yml +++ b/.github/workflows/argocd-destroy.yml @@ -122,7 +122,7 @@ jobs: BRANCH_NAME: ${{ github.event.pull_request.head.ref || github.ref_name }} run: | set -x - pretty_branch_name="$(echo -n "${BRANCH_NAME#refs/heads/}" | sed 's#/#-#g' | sed 's#_#-#g'| sed 's#\.#-#g' | tr '[:upper:]' '[:lower:]' | cut -c1-25)" + pretty_branch_name="$(echo -n "${BRANCH_NAME#refs/heads/}" | sed -E 's#[/_\.-]+#-#g' | tr '[:upper:]' '[:lower:]' | cut -c1-25 | sed -E 's#-$##g')" echo "pretty_branch_name=${pretty_branch_name}" >> "${GITHUB_OUTPUT}" - name: Delete ArgoCD App diff --git a/.github/workflows/argocd-scaledown.yml b/.github/workflows/argocd-scaledown.yml index d590d10c..623438e5 100644 --- a/.github/workflows/argocd-scaledown.yml +++ b/.github/workflows/argocd-scaledown.yml @@ -122,7 +122,7 @@ jobs: BRANCH_NAME: ${{ github.event.pull_request.head.ref || github.ref_name }} run: | set -x - pretty_branch_name="$(echo -n "${BRANCH_NAME#refs/heads/}" | sed 's#/#-#g' | sed 's#_#-#g'| sed 's#\.#-#g' | tr '[:upper:]' '[:lower:]' | cut -c1-25)" + pretty_branch_name="$(echo -n "${BRANCH_NAME#refs/heads/}" | sed -E 's#[/_\.-]+#-#g' | tr '[:upper:]' '[:lower:]' | cut -c1-25 | sed -E 's#-$##g')" echo "pretty_branch_name=${pretty_branch_name}" >> "${GITHUB_OUTPUT}" - name: Scaledown ArgoCD App diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index f97bcc4b..1a075f0c 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -63,8 +63,8 @@ jobs: BRANCH_NAME: ${{ inputs.branch_name }} run: | set -x - pretty_branch_name="$(echo -n "${BRANCH_NAME#refs/heads/}" | sed 's#/#-#g' | sed 's#_#-#g'| sed 's#\.#-#g' | tr '[:upper:]' '[:lower:]')" - echo "pretty_branch_name=$pretty_branch_name" >> $GITHUB_OUTPUT + pretty_branch_name="$(echo -n "${BRANCH_NAME#refs/heads/}" | sed -E 's#[/_\.-]+#-#g' | tr '[:upper:]' '[:lower:]' | cut -c1-25 | sed -E 's#-$##g')" + echo "pretty_branch_name=${pretty_branch_name}" >> "${GITHUB_OUTPUT}" current_time="$(date +'%Y%m%d.%H%M%S')" branch="-${pretty_branch_name}" short_sha="$(git rev-parse --short HEAD)"