Skip to content

Commit b298c96

Browse files
kiaquilaOmX
andcommitted
Skip first install AI review gate
Adjust the AI Review workflow so the first Unicorn Hub bootstrap PR succeeds when trusted review scripts are not yet present on the base branch. After this PR is merged, future pull requests will run the trusted scripts from main instead of PR-provided review gate code. Constraint: First-install bootstrap skips only when trusted review scripts are absent on the base branch Tested: ruby YAML parse for .github/workflows/ai-review.yml; pnpm run check:repo; node scripts/check-feature-memory.mjs --worktree Co-authored-by: OmX <omx@oh-my-codex.dev>
1 parent 3eea24d commit b298c96

1 file changed

Lines changed: 16 additions & 13 deletions

File tree

.github/workflows/ai-review.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -44,21 +44,29 @@ jobs:
4444
path: .gate-trusted
4545
fetch-depth: 1
4646

47-
- name: Resolve PR context
48-
id: pr
47+
- name: Resolve trusted review script availability
48+
id: trusted
49+
shell: bash
4950
run: |
50-
if [ -f .gate-trusted/scripts/resolve-pr-context.mjs ]; then
51-
node .gate-trusted/scripts/resolve-pr-context.mjs
51+
if [ -f .gate-trusted/scripts/resolve-pr-context.mjs ] && [ -f .gate-trusted/scripts/ai-review-gate.mjs ]; then
52+
echo "available=true" >> "$GITHUB_OUTPUT"
5253
else
53-
echo "::warning::Trusted review script missing on default branch; using PR script for first-install bootstrap only."
54-
node scripts/resolve-pr-context.mjs
54+
echo "::notice::Trusted AI review scripts are not installed on the base branch yet; skipping AI Review enforcement for the first Unicorn Hub bootstrap PR."
55+
echo "available=false" >> "$GITHUB_OUTPUT"
5556
fi
57+
58+
- name: Resolve PR context
59+
id: pr
60+
if: steps.trusted.outputs.available == 'true'
61+
run: |
62+
node .gate-trusted/scripts/resolve-pr-context.mjs
5663
env:
5764
GITHUB_TOKEN: ${{ github.token }}
5865
AI_REVIEW_PR_NUMBER: ${{ inputs.pr_number }}
5966

6067
- name: Resolve selected review policy
6168
id: policy
69+
if: steps.trusted.outputs.available == 'true'
6270
shell: bash
6371
env:
6472
SELECTED_AGENT: ${{ vars.AI_REVIEW_AGENT }}
@@ -91,13 +99,8 @@ jobs:
9199
echo "trigger_mode=$trigger_mode" >> "$GITHUB_OUTPUT"
92100
93101
- name: Route and validate selected native review
94-
run: |
95-
if [ -f .gate-trusted/scripts/ai-review-gate.mjs ]; then
96-
node .gate-trusted/scripts/ai-review-gate.mjs
97-
else
98-
echo "::warning::Trusted review script missing on default branch; using PR script for first-install bootstrap only."
99-
node scripts/ai-review-gate.mjs
100-
fi
102+
if: steps.trusted.outputs.available == 'true'
103+
run: node .gate-trusted/scripts/ai-review-gate.mjs
101104
env:
102105
GITHUB_TOKEN: ${{ github.token }}
103106
AI_REVIEW_AGENT: ${{ steps.policy.outputs.selected_agent }}

0 commit comments

Comments
 (0)