Skip to content

Commit 4428ec4

Browse files
committed
Address cpflow workflow review comments
1 parent fee6ce9 commit 4428ec4

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

.github/actions/cpflow-validate-config/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ runs:
3939
missing=()
4040
while IFS= read -r entry; do
4141
entry="${entry%$'\r'}"
42-
entry="${entry## }"
43-
entry="${entry%% }"
42+
entry="$(printf '%s' "${entry}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')"
4443
[[ -z "${entry}" ]] && continue
4544
4645
type="${entry%%:*}"
@@ -71,5 +70,6 @@ runs:
7170
exit 0
7271
fi
7372
74-
printf 'Missing required GitHub configuration:\n- %s\n' "${missing[@]}" >&2
73+
echo "Missing required GitHub configuration:" >&2
74+
printf -- '- %s\n' "${missing[@]}" >&2
7575
exit 1

.github/actions/cpflow-wait-for-health/action.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,10 @@ runs:
6161
for attempt in $(seq 1 "${CPFLOW_MAX_RETRIES}"); do
6262
echo "Health check attempt ${attempt}/${CPFLOW_MAX_RETRIES}"
6363
64-
endpoint="$(cpln workload get "${CPFLOW_WORKLOAD_NAME}" --gvc "${CPFLOW_APP_NAME}" --org "${CPFLOW_ORG}" -o json | jq -r '.status.endpoint // empty')"
64+
if ! endpoint="$(cpln workload get "${CPFLOW_WORKLOAD_NAME}" --gvc "${CPFLOW_APP_NAME}" --org "${CPFLOW_ORG}" -o json | jq -r '.status.endpoint // empty')"; then
65+
echo "Unable to fetch workload endpoint; will retry if attempts remain."
66+
endpoint=""
67+
fi
6568
if [[ -n "${endpoint}" ]]; then
6669
http_status="$(curl -s -o /dev/null -w '%{http_code}' --max-time "${CPFLOW_CURL_MAX_TIME}" "${endpoint}" 2>/dev/null || echo 000)"
6770
echo "Endpoint: ${endpoint}, HTTP status: ${http_status}"

0 commit comments

Comments
 (0)