File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -108,10 +108,15 @@ resolve-cassandra-version: .prepare-get-version
108108 exit 0
109109 fi
110110
111- if [[ "${CASSANDRA_VERSION}" == "4-LATEST" ]]; then
112- CASSANDRA_VERSION_RESOLVED=$$(get-version -source github-tag -repo apache/cassandra -prefix "cassandra-" -out-no-prefix -filters "^[0-9]+$$.^[0-9]+$$.^[0-9]+$$ and 4.LAST.LAST" | tr -d '\"')
113- elif [[ "${CASSANDRA_VERSION}" == "3-LATEST" ]]; then
114- CASSANDRA_VERSION_RESOLVED=$$(get-version -source github-tag -repo apache/cassandra -prefix "cassandra-" -out-no-prefix -filters "^[0-9]+$$.^[0-9]+$$.^[0-9]+$$ and 3.LAST.LAST" | tr -d '\"')
111+ if [[ "${CASSANDRA_VERSION}" == "4-LATEST" || "${CASSANDRA_VERSION}" == "3-LATEST" ]]; then
112+ # Resolve latest Cassandra tags through the authenticated GitHub API to avoid
113+ # anonymous rate limits when the integration matrix fans out.
114+ major=$${CASSANDRA_VERSION%%-*}
115+ CASSANDRA_VERSION_RESOLVED=$$(gh api repos/apache/cassandra/tags --paginate --jq '.[].name' \
116+ | sed 's/^cassandra-//' \
117+ | awk -F. -v major="$$major" '$$1 == major && $$2 ~ /^[0-9]+$$/ && $$3 ~ /^[0-9]+$$/ { print }' \
118+ | sort -V \
119+ | tail -n 1)
115120 elif echo "${CASSANDRA_VERSION}" | grep -P '^[0-9\.]+'; then
116121 CASSANDRA_VERSION_RESOLVED=${CASSANDRA_VERSION}
117122 else
You can’t perform that action at this time.
0 commit comments