[codex] Install Unicorn Hub Flutter profile #2
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: AI Review | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened, ready_for_review] | |
| workflow_dispatch: | |
| inputs: | |
| pr_number: | |
| description: Pull request number to validate | |
| required: true | |
| trigger_mode: | |
| description: Review trigger mode; use skip unless a backend explicitly supports automation | |
| required: false | |
| default: skip | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| issues: write | |
| concurrency: | |
| group: ai-review-${{ github.event.pull_request.number || inputs.pr_number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| ai-review: | |
| name: AI Review | |
| if: | | |
| github.event_name == 'workflow_dispatch' || | |
| github.event.pull_request.draft == false | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - name: Checkout PR content | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| fetch-depth: 1 | |
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
| - name: Checkout trusted review scripts | |
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| with: | |
| ref: ${{ github.event.pull_request.base.sha || github.event.repository.default_branch }} | |
| path: .gate-trusted | |
| fetch-depth: 1 | |
| - name: Resolve PR context | |
| id: pr | |
| run: | | |
| if [ -f .gate-trusted/scripts/resolve-pr-context.mjs ]; then | |
| node .gate-trusted/scripts/resolve-pr-context.mjs | |
| else | |
| echo "::warning::Trusted review script missing on default branch; using PR script for first-install bootstrap only." | |
| node scripts/resolve-pr-context.mjs | |
| fi | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| AI_REVIEW_PR_NUMBER: ${{ inputs.pr_number }} | |
| - name: Resolve selected review policy | |
| id: policy | |
| shell: bash | |
| env: | |
| SELECTED_AGENT: ${{ vars.AI_REVIEW_AGENT }} | |
| REQUESTED_TRIGGER_MODE: ${{ inputs.trigger_mode }} | |
| EVENT_NAME: ${{ github.event_name }} | |
| run: | | |
| set -euo pipefail | |
| selected="${SELECTED_AGENT:-codex}" | |
| selected="${selected:-codex}" | |
| case "$selected" in | |
| codex|claude|gemini) ;; | |
| *) | |
| echo "::error::Unsupported AI_REVIEW_AGENT value: '$selected'. Allowed: codex, claude, gemini." | |
| exit 1 | |
| ;; | |
| esac | |
| if [ "${EVENT_NAME}" = "workflow_dispatch" ]; then | |
| trigger_mode="${REQUESTED_TRIGGER_MODE:-skip}" | |
| else | |
| trigger_mode="skip" | |
| fi | |
| case "$trigger_mode" in | |
| skip|comment) ;; | |
| *) | |
| echo "::error::Unsupported AI_REVIEW_TRIGGER_MODE value: '$trigger_mode'. Allowed: skip, comment." | |
| exit 1 | |
| ;; | |
| esac | |
| echo "selected_agent=$selected" >> "$GITHUB_OUTPUT" | |
| echo "trigger_mode=$trigger_mode" >> "$GITHUB_OUTPUT" | |
| - name: Route and validate selected native review | |
| run: | | |
| if [ -f .gate-trusted/scripts/ai-review-gate.mjs ]; then | |
| node .gate-trusted/scripts/ai-review-gate.mjs | |
| else | |
| echo "::warning::Trusted review script missing on default branch; using PR script for first-install bootstrap only." | |
| node scripts/ai-review-gate.mjs | |
| fi | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| AI_REVIEW_AGENT: ${{ steps.policy.outputs.selected_agent }} | |
| AI_REVIEW_PR_NUMBER: ${{ steps.pr.outputs.pr_number }} | |
| AI_REVIEW_HEAD_SHA: ${{ steps.pr.outputs.head_sha }} | |
| AI_REVIEW_TRIGGER_MODE: ${{ steps.policy.outputs.trigger_mode }} | |
| AI_REVIEW_WAIT_MS: "1200000" | |
| AI_REVIEW_POLL_MS: "15000" |