Count the time the polls take toward the release wait, not just the sleeps

Merged
JE
8d ago
+5-4

#201's wait loop added 30 to ELAPSED per sleep, so each poll's request and jq ran on top of the 5.5-hour budget. Over ~660 polls that overhead can push the loop past the job's timeout-minutes: 340, and the job gets killed before it prints the "Timed out waiting" error and final status.

This uses bash's SECONDS, which measures wall-clock time, so the wait ends at 19,800 s and leaves about 10 minutes of the 340 for the report. It's the same fix as hey-sdk f26a09b, which came from Copilot's finding on hey-sdk#264.

The request budget is unchanged: one actions/runs request per 30 s poll, about 120 an hour against GITHUB_TOKEN's 1,000.


Summary by cubic

Fixes the release wait loop so wall-clock time, not just the sleep intervals, counts toward the 5.5-hour budget.

  • The old ELAPSED counter added 30 s per sleep, ignoring each poll's API request and jq processing, so ~660 polls could push the loop past the job's 340-minute timeout before the "Timed out waiting" error and final status printed.
  • Bash's SECONDS measures wall-clock time, ending the wait at 19,800 s and leaving about 10 minutes of the 340 for the report.
  • The request budget is unchanged: one actions/runs request per 30 s poll.