Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 18 additions & 10 deletions .github/workflows/release-github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
name: Wait for SDK publishes
if: github.event_name == 'push'
runs-on: ubuntu-latest
timeout-minutes: 340
permissions:
actions: read
steps:
Expand All @@ -28,7 +29,7 @@ jobs:
run: |
WORKFLOWS=("release-go.yml" "release-typescript.yml" "release-ruby.yml" "release-swift.yml" "release-kotlin.yml" "release-rust.yml")
TAG="${GITHUB_REF#refs/tags/}"
MAX_WAIT=1800 # 30 minutes
MAX_WAIT=19800 # 5.5 hours: each publish now waits for a reviewer's approval
Comment thread
jeremy marked this conversation as resolved.
POLL=30
ELAPSED=0

Expand All @@ -37,16 +38,23 @@ jobs:
ANY_FAILED=false
STATUS_LINE=""

# One request per poll for every run on this commit: a per-workflow
# `gh run list --workflow` costs two requests each, and six of them
# every 30s outruns GITHUB_TOKEN's 1,000 requests/hour well inside
# the approval wait.
RUNS_JSON=$(gh api \
"repos/$GITHUB_REPOSITORY/actions/runs?head_sha=$GITHUB_SHA&event=push&per_page=100" \
--jq '.workflow_runs') || {
# A transient API error shouldn't end a wait measured in hours
echo "::warning::Listing workflow runs failed; retrying next poll"
RUNS_JSON='[]'
}

for WF in "${WORKFLOWS[@]}"; do
# Fetch recent runs and find the one matching this tag push
RUN_JSON=$(gh run list \
--repo "$GITHUB_REPOSITORY" \
--workflow "$WF" \
--branch "$TAG" \
--event push \
--limit 5 \
--json conclusion,headSha \
--jq "[.[] | select(.headSha == \"$GITHUB_SHA\")] | .[0] // empty")
# Newest run of this workflow for this tag push
RUN_JSON=$(echo "$RUNS_JSON" | jq -c \
--arg path ".github/workflows/$WF" --arg tag "$TAG" \
'[.[] | select((.path | sub("@.*$"; "")) == $path and .head_branch == $tag)] | .[0] // empty')

if [ -z "$RUN_JSON" ]; then
ALL_DONE=false
Expand Down
Loading