CI pipeline breaks when there are no tags for a release branch yet

Closes #43057

Signed-off-by: Ryan Emerson <remerson@ibm.com>
This commit is contained in:
Ryan Emerson 2025-10-08 08:26:58 +01:00 committed by GitHub
parent 817c78f0d9
commit 12ae8b7cc9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 3 deletions

View File

@ -9,6 +9,7 @@ REPO="${2:-keycloak}"
ORG="${3:-keycloak}"
if [[ "${TARGET_BRANCH}" != "release/"* ]]; then
echo "skip"
exit 0
fi
@ -20,6 +21,10 @@ ALL_RELEASES=$(gh release list \
--template '{{range .}}{{.name}}{{"\n"}}{{end}}'
)
MAJOR_MINOR=${TARGET_BRANCH#"release/"}
MAJOR_MINOR_RELEASES=$(echo "${ALL_RELEASES}" | grep "${MAJOR_MINOR}")
MAJOR_MINOR_RELEASES=$(echo "${ALL_RELEASES}" | (grep "${MAJOR_MINOR}" || true))
echo "${MAJOR_MINOR_RELEASES}" | jq -cnR '[inputs] | map({version: .})'
if [[ -z "${MAJOR_MINOR_RELEASES}" ]]; then
echo "skip"
else
echo -n "${MAJOR_MINOR_RELEASES}" | jq -cnR '[inputs] | map({version: .})'
fi

View File

@ -898,7 +898,7 @@ jobs:
mixed-cluster-compatibility-tests:
name: Cluster Compatibility Tests
if: needs.conditional.outputs.ci-compatibility-matrix != ''
if: needs.conditional.outputs.ci-compatibility-matrix != 'skip'
runs-on: ubuntu-latest
needs:
- build