Skip to content

Commit 12ae8b7

Browse files
authored
CI pipeline breaks when there are no tags for a release branch yet
Closes #43057 Signed-off-by: Ryan Emerson <[email protected]>
1 parent 817c78f commit 12ae8b7

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.github/scripts/version-compatibility.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ REPO="${2:-keycloak}"
99
ORG="${3:-keycloak}"
1010

1111
if [[ "${TARGET_BRANCH}" != "release/"* ]]; then
12+
echo "skip"
1213
exit 0
1314
fi
1415

@@ -20,6 +21,10 @@ ALL_RELEASES=$(gh release list \
2021
--template '{{range .}}{{.name}}{{"\n"}}{{end}}'
2122
)
2223
MAJOR_MINOR=${TARGET_BRANCH#"release/"}
23-
MAJOR_MINOR_RELEASES=$(echo "${ALL_RELEASES}" | grep "${MAJOR_MINOR}")
24+
MAJOR_MINOR_RELEASES=$(echo "${ALL_RELEASES}" | (grep "${MAJOR_MINOR}" || true))
2425

25-
echo "${MAJOR_MINOR_RELEASES}" | jq -cnR '[inputs] | map({version: .})'
26+
if [[ -z "${MAJOR_MINOR_RELEASES}" ]]; then
27+
echo "skip"
28+
else
29+
echo -n "${MAJOR_MINOR_RELEASES}" | jq -cnR '[inputs] | map({version: .})'
30+
fi

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,7 @@ jobs:
898898

899899
mixed-cluster-compatibility-tests:
900900
name: Cluster Compatibility Tests
901-
if: needs.conditional.outputs.ci-compatibility-matrix != ''
901+
if: needs.conditional.outputs.ci-compatibility-matrix != 'skip'
902902
runs-on: ubuntu-latest
903903
needs:
904904
- build

0 commit comments

Comments
 (0)