diff --git a/.gitea/scripts/add-annotations.sh b/.gitea/scripts/add-annotations.sh index 702d1c0..6cd9855 100755 --- a/.gitea/scripts/add-annotations.sh +++ b/.gitea/scripts/add-annotations.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -e +set -eo pipefail CHART_FILE="Chart.yaml" if [ ! -f "${CHART_FILE}" ]; then diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml index 8b5fbd8..82ccdec 100644 --- a/.gitea/workflows/release.yaml +++ b/.gitea/workflows/release.yaml @@ -71,8 +71,9 @@ jobs: - name: Add Artifacthub.io annotations run: | - NEW_TAG="$(git tag --sort=-version:refname | head -n 1)" - OLD_TAG="$(git tag --sort=-version:refname | head -n 2 | tail -n 1)" + rc_pattern="\-rc([-\.][0-9]+)?$" + NEW_TAG="$(git tag --sort=-version:refname | grep --invert-match --perl-regexp "${rc_pattern}" | head --lines 1)" + OLD_TAG="$(git tag --sort=-version:refname | grep --invert-match --perl-regexp "${rc_pattern}" | head --lines 2 | tail --lines 1)" .gitea/scripts/add-annotations.sh "${OLD_TAG}" "${NEW_TAG}" - name: Extract meta information