Skip to content

Commit 61edbe9

Browse files
committed
fix: harden AI review workflows
1 parent 0dfe3e6 commit 61edbe9

3 files changed

Lines changed: 11 additions & 15 deletions

File tree

.github/workflows/expo-code-review-command.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ env:
2323
# Published reviewer run via npx (override with repo variable ECR_VERSION; pin to
2424
# a specific version to freeze it). Used for the guard AND the review so the engine
2525
# that clears a config is the same engine that then reads it.
26-
ECR_VERSION: ${{ vars.ECR_VERSION || 'latest' }}
26+
ECR_VERSION: ${{ vars.ECR_VERSION || '0.14.0' }}
2727

2828
concurrency:
2929
group: ai-code-review-cmd-${{ github.event.issue.number }}
@@ -124,7 +124,6 @@ jobs:
124124
# @ref LLP 0009#guard-step-ordering-and-job-budgets [implements] — same $ECR_VERSION feeds guard and review
125125
- name: Guard config tokenEnv (root + routing + all scopes)
126126
if: steps.cmd.outputs.run == 'true'
127-
continue-on-error: true
128127
env:
129128
# (Comma-separated set for a multi-credential auth.providers config.)
130129
ECR_EXPECTED_TOKEN_ENV: ${{ vars.ECR_EXPECTED_TOKEN_ENV || 'META_API_KEY' }}

.github/workflows/expo-code-review-dismiss.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ permissions:
1919

2020
env:
2121
# Published reviewer run via npx (override with repo variable ECR_VERSION).
22-
# Floor at 0.2.3 — the first version that ships `ecr dismiss`/`undismiss`.
23-
ECR_VERSION: ${{ vars.ECR_VERSION || '^0.2.3' }}
22+
ECR_VERSION: ${{ vars.ECR_VERSION || '0.14.0' }}
2423

2524
concurrency:
2625
group: ai-code-review-dismiss-${{ github.event.issue.number }}

.github/workflows/expo-code-review.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,15 @@ jobs:
2222
# Version of the published engine used for BOTH the guard and the review, so
2323
# the guard that clears a config is the same engine that then reads it. Override
2424
# with repo variable ECR_VERSION; pin to a specific version to freeze it.
25-
ECR_VERSION: ${{ vars.ECR_VERSION || 'latest' }}
26-
# Trigger policy lives in .expo-code-review/config.jsonc (review.trigger); `ecr ci`
27-
# self-gates on it (and honors the ai-review:skip label). This coarse gate just
28-
# avoids spinning up a runner for a PR that explicitly opted out. Uses the array
29-
# form of contains() for an EXACT label match ("ai-review:skip" is not "ai-review").
30-
# Prefer to gate entirely here instead? Set config trigger to "label" and replace
31-
# the line below with, e.g.:
32-
# if: contains(github.event.pull_request.labels.*.name, 'ai-review')
33-
# @ref LLP 0009#guard-step-ordering-and-job-budgets [explains] — spin-up avoidance only; real policy is config.jsonc review.trigger
34-
if: ${{ !contains(github.event.pull_request.labels.*.name, 'ai-review:skip') }}
25+
ECR_VERSION: ${{ vars.ECR_VERSION || '0.14.0' }}
26+
# Auto-review only labeled same-repository branches. GitHub withholds the model
27+
# secret and write token from fork pull_request jobs; maintainers can use /review
28+
# for forks through the base-context issue_comment workflow.
29+
# @ref LLP 0009#guard-step-ordering-and-job-budgets [explains] — exact label and fork gates avoid guaranteed no-op runners
30+
if: >-
31+
contains(github.event.pull_request.labels.*.name, 'ai-review') &&
32+
!contains(github.event.pull_request.labels.*.name, 'ai-review:skip') &&
33+
github.event.pull_request.head.repo.full_name == github.repository
3534
# Backstop so a stalled review fails fast instead of hanging. This is the ONE cap
3635
# with no soft landing (GitHub hard-kills the job and nothing is posted), so keep
3736
# margin over the worst-case internal chain: the passes budget
@@ -85,7 +84,6 @@ jobs:
8584
# from the registry — it never builds or executes the PR's code.
8685
# @ref LLP 0009#guard-step-ordering-and-job-budgets [implements] — layer 2; layer 1 is ecr ci's own runtime check
8786
- name: Guard config tokenEnv (root + routing + all scopes)
88-
continue-on-error: true
8987
env:
9088
# (Comma-separated set for a multi-credential auth.providers config.)
9189
ECR_EXPECTED_TOKEN_ENV: ${{ vars.ECR_EXPECTED_TOKEN_ENV || 'META_API_KEY' }}

0 commit comments

Comments
 (0)