File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -234,8 +234,9 @@ jobs:
234234 --workflow "$WORKFLOW" \
235235 --event workflow_dispatch \
236236 --created ">=$TRIGGER_TIME" \
237- --json databaseId \
238- --jq '.[0].databaseId // empty')
237+ --limit 1 \
238+ --json databaseId,createdAt \
239+ --jq 'sort_by(.createdAt) | .[0].databaseId // empty')
239240
240241 if [[ -n "$RUN_ID" ]]; then
241242 echo "Found workflow run: $RUN_ID"
@@ -287,16 +288,17 @@ jobs:
287288 echo "Workflow dispatch triggered, waiting for run to appear..."
288289 sleep 15
289290
290- # Find the run we just triggered
291+ # Find the run we just triggered (oldest after TRIGGER_TIME)
291292 RUN_ID=""
292293 for i in $(seq 1 12); do
293294 RUN_ID=$(gh run list \
294295 --repo "$REPO" \
295296 --workflow "$WORKFLOW" \
296297 --event workflow_dispatch \
297298 --created ">=$TRIGGER_TIME" \
298- --json databaseId \
299- --jq '.[0].databaseId // empty')
299+ --limit 1 \
300+ --json databaseId,createdAt \
301+ --jq 'sort_by(.createdAt) | .[0].databaseId // empty')
300302
301303 if [[ -n "$RUN_ID" ]]; then
302304 echo "Found workflow run: $RUN_ID"
You can’t perform that action at this time.
0 commit comments