Repository navigation
fix(api): jitter the failover backoff, and retry a 503 only with Retry-After #1443
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release gate | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| pull_request_review: | |
| types: [submitted, dismissed] | |
| permissions: | |
| pull-requests: read | |
| jobs: | |
| release-gate: | |
| name: Release gate | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check release PR requirements | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| HEAD_REF: ${{ github.event.pull_request.head.ref }} | |
| PR_AUTHOR: ${{ github.event.pull_request.user.login }} | |
| PR_NUMBER: ${{ github.event.pull_request.number }} | |
| REPO: ${{ github.repository }} | |
| run: | | |
| if [[ "$HEAD_REF" != release/* ]]; then | |
| echo "Not a release PR, skipping" | |
| exit 0 | |
| fi | |
| if [ "$PR_AUTHOR" != "github-actions[bot]" ]; then | |
| echo "::error::Release PRs must be created by the publish workflow, not by '$PR_AUTHOR'" | |
| exit 1 | |
| fi | |
| approvals=$(gh api "repos/$REPO/pulls/$PR_NUMBER/reviews" \ | |
| --jq '[group_by(.user.login)[] | sort_by(.submitted_at) | last | select(.state == "APPROVED") | .user.login] | length') | |
| echo "Approvals: $approvals" | |
| if [ "$approvals" -lt 2 ]; then | |
| echo "::error::Release PRs require at least 2 approvals (got $approvals)" | |
| exit 1 | |
| fi |