Skip to content

Commit 1491f78

Browse files
committed
Kick off the runner script over and over until there are no more queued jobs.
1 parent 7e41a53 commit 1491f78

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/site.preview.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,16 @@ jobs:
2424
repository: 'operations-project/github-runner-starter'
2525
ref: 'v1.2.1'
2626

27+
# Kick off the runner script over and over until there are no more queued jobs.
2728
- name: "Launch runner script."
2829
run: |
29-
./github-runner-starter \
30+
while [[ $(curl -s -H "Authorization: token ${{ GITHUB_TOKEN }}" "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs" | jq -r '.jobs[] | select(.status=="queued") | .id' | wc -l) -gt 0 ]]; do
31+
./github-runner-starter \
3032
--run \
3133
--name=github.actions.runner.${{ github.run_id }}.${{ matrix.runner }} \
3234
--labels=github.actions.runner.${{ github.run_id }}
33-
# --config-sh-options=--ephemeral
35+
--config-sh-options=--ephemeral
36+
done
3437
3538
create-site:
3639
name: Create Preview Site

0 commit comments

Comments
 (0)