diff --git a/.github/workflows/helm-weekly-release-pr.yaml b/.github/workflows/helm-weekly-release-pr.yaml index 3dd17aac136c7..7dae425c931c0 100644 --- a/.github/workflows/helm-weekly-release-pr.yaml +++ b/.github/workflows/helm-weekly-release-pr.yaml @@ -38,7 +38,7 @@ jobs: # - run: | # echo "${{ env.DOCKER_PASSWORD }}" | crane auth login registry.hub.docker.com --username "${{ env.DOCKER_USERNAME }}" --password-stdin - - name: Update/regenerate files + - name: Update/regenerate files for k release id: update-k run: | bash .github/workflows/scripts/helm-weekly-release.sh -k @@ -54,7 +54,7 @@ jobs: base: ${{ steps.update-k.outputs.weekly }} labels: helm - - name: Update/regenerate files + - name: Update/regenerate files for standard release id: update run: bash .github/workflows/scripts/helm-weekly-release.sh diff --git a/.github/workflows/scripts/helm-weekly-release.sh b/.github/workflows/scripts/helm-weekly-release.sh index 8ec8e9a636faa..662e3bb8a8a3e 100755 --- a/.github/workflows/scripts/helm-weekly-release.sh +++ b/.github/workflows/scripts/helm-weekly-release.sh @@ -12,10 +12,8 @@ find_latest_image_tag() { local docker_hub_repo=$1 local regExp="^(k|weekly-k)\d+-[a-z0-9]+" local crane_results - crane_results=$(crane ls "${docker_hub_repo}" | grep -P "${regExp}") - local sorted_results - sorted_results="$(echo "${crane_results}" | sed -E "s/([weekly-]*k[[:digit:]]*)-([^-]*).*/\1-\2/g" | sort -Vur)" - echo "${sorted_results}" | tail -n +1 | head -1 + crane_results="$(crane ls "${docker_hub_repo}" | grep -P "${regExp}" | sed -E "s/([weekly-]*k[[:digit:]]*)-([^-]*).*/\1-\2/g" | sort -Vur)" + echo "${crane_results}" | tail -n +1 | head -1 } # takes k197-abcdef and returns r197, k197-abcdef-arm64 and returns k197, weekly-k197-abcdef and returns k197