perf[vortex-array]: use from_trusted_len_iter in primitive casts #243
Workflow file for this run
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: PR Approval Check | |
| on: | |
| pull_request_review: | |
| types: [submitted, dismissed] | |
| jobs: | |
| check-approvals: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check required approvals | |
| uses: actions/github-script@450193c5abd4cdb17ba9f3ffcfe8f635c4bb6c2a | |
| with: | |
| script: | | |
| const pr = context.payload.pull_request; | |
| const reviews = await github.rest.pulls.listReviews({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| pull_number: pr.number, | |
| }); | |
| // Count unique human approvals (latest review per user) | |
| const latestByUser = {}; | |
| for (const review of reviews.data) { | |
| if (review.user.type === 'Bot') continue; | |
| latestByUser[review.user.login] = review.state; | |
| } | |
| const approvalCount = Object.values(latestByUser) | |
| .filter(state => state === 'APPROVED').length; | |
| // Determine if PR author is a bot/GitHub Actions | |
| const authorType = pr.user.type; // 'Bot' vs 'User' | |
| const authorLogin = pr.user.login; // e.g. 'github-actions[bot]' | |
| const isBot = authorType === 'Bot' || authorLogin.endsWith('[bot]'); | |
| const required = isBot ? 2 : 1; | |
| console.log(`PR author: ${authorLogin} (${authorType}), isBot: ${isBot}`); | |
| console.log(`Approvals: ${approvalCount} / ${required} required`); | |
| if (approvalCount < required) { | |
| core.setFailed( | |
| `This PR needs ${required} human approval(s) but has ${approvalCount}. ` + | |
| `(Author is ${isBot ? 'a bot' : 'human'})` | |
| ); | |
| } |