Skip to content

Commit c850034

Browse files
committed
fix(wait-for-hydra): send debug echo to stderr in poll_github
The poll_github function echoes a "Querying: ..." debug line to stdout. Since poll_wait captures its output via conclusion=$(poll_github), the conclusion variable contains the debug line concatenated with the actual gh api result — a multi-line string like "Querying: ...\nsuccess". The case "$conclusion" in poll_wait never matches "success" because the variable isn't a bare keyword — it's the debug text plus the result. This causes the action to loop until timeout even when the check has already passed. Fix: redirect debug echo to stderr (>&2) so only the gh api result is captured by the caller.
1 parent 1388cec commit c850034

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

wait-for-hydra/support/wait.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,15 +213,15 @@ sse_wait() {
213213

214214
poll_github() {
215215
if [ -n "$CHECK" ]; then
216-
echo "Querying: gh api repos/$GITHUB_REPOSITORY/commits/$RELEVANT_SHA/check-runs --paginate --jq '...select(.name == \"$CHECK\")...'"
216+
echo "Querying: gh api repos/$GITHUB_REPOSITORY/commits/$RELEVANT_SHA/check-runs --paginate --jq '...select(.name == \"$CHECK\")...'" >&2
217217
# Use tail -1 to handle paginated results that may concatenate
218218
# multiple values; take the last (most recent) non-empty line.
219219
gh api "repos/$GITHUB_REPOSITORY/commits/$RELEVANT_SHA/check-runs" \
220220
--paginate \
221221
--jq ".check_runs[] | select(.name == \"$CHECK\") | .conclusion" \
222222
| tail -1
223223
else
224-
echo "Querying: gh api repos/$GITHUB_REPOSITORY/commits/$RELEVANT_SHA/status --paginate --jq '...select(.context == \"$STATUS\")...'"
224+
echo "Querying: gh api repos/$GITHUB_REPOSITORY/commits/$RELEVANT_SHA/status --paginate --jq '...select(.context == \"$STATUS\")...'" >&2
225225
gh api "repos/$GITHUB_REPOSITORY/commits/$RELEVANT_SHA/status" \
226226
--paginate \
227227
--jq ".statuses[] | select(.context == \"$STATUS\") | .state" \

0 commit comments

Comments
 (0)