keycloak/.github/scripts/version-compatibility.sh
Ryan Emerson f0c623598e
Run clustering compatibility tests on release/x.y branches
Closes #39966

Signed-off-by: Ryan Emerson <remerson@redhat.com>
2025-07-07 21:08:11 +02:00

25 lines
No EOL
553 B
Bash
Executable file

#!/bin/bash -e
if [[ "$RUNNER_DEBUG" == "1" ]]; then
set -x
fi
TARGET_BRANCH="$1"
REPO="${2:-keycloak}"
ORG="${3:-keycloak}"
if [[ "${TARGET_BRANCH}" != "release/"* ]]; then
exit 0
fi
ALL_RELEASES=$(gh release list \
--repo "${ORG}/${REPO}" \
--exclude-drafts \
--exclude-pre-releases \
--json name \
--template '{{range .}}{{.name}}{{"\n"}}{{end}}'
)
MAJOR_MINOR=${TARGET_BRANCH#"release/"}
MAJOR_MINOR_RELEASES=$(echo "${ALL_RELEASES}" | grep "${MAJOR_MINOR}")
echo "${MAJOR_MINOR_RELEASES}" | jq -cnR '[inputs] | map({version: .})'