-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Opened against wrong repo — please ignore #3686
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
ccb4506
089b1da
18a160e
b6c0e06
abe850d
b16c18b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| name: Codex review gate | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened, ready_for_review] | ||
| pull_request_review: | ||
| types: [submitted] | ||
|
|
||
| permissions: | ||
| pull-requests: read | ||
|
Comment on lines
+9
to
+10
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Medium The workflow grants only permissions:
pull-requests: read
+ issues: read🤖 Copy this AI Prompt to have your agent fix this: |
||
|
|
||
| jobs: | ||
| codex-review-required: | ||
| name: codex-review-required | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 20 | ||
| steps: | ||
| - name: Require one Codex review on this PR | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| REPO: ${{ github.repository }} | ||
| PR: ${{ github.event.pull_request.number }} | ||
| run: | | ||
| codex_reviewed() { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟠 High
🤖 Copy this AI Prompt to have your agent fix this: |
||
| local n | ||
| n=$(gh api "repos/$REPO/pulls/$PR/reviews" --paginate | jq -s ' | ||
| [add[] | select( | ||
| (.user.type == "Bot") | ||
| and (.user.login | ascii_downcase | contains("codex")) | ||
| and (.state != "DISMISSED") | ||
| )] | length') | ||
| [ "$n" -ge 1 ] && return 0 | ||
| # A clean Codex review ("no major issues") arrives as an issue | ||
| # comment carrying "Reviewed commit: `<sha>`", not as a PR review. | ||
| n=$(gh api "repos/$REPO/issues/$PR/comments" --paginate | jq -s ' | ||
| [add[] | select( | ||
| (.user.type == "Bot") | ||
| and (.user.login | ascii_downcase | contains("codex")) | ||
| and (.body | test("Reviewed commit:")) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This accepts any old clean Codex comment because it only tests for the marker, and the review path above similarly counts all non-dismissed Codex reviews without checking the review Useful? React with 👍 / 👎. |
||
| )] | length') | ||
| [ "$n" -ge 1 ] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Gate accepts stale Codex reviewsMedium Severity The Codex review gate treats any historical bot comment containing Reviewed by Cursor Bugbot for commit b16c18b. Configure here. |
||
| } | ||
|
|
||
| for i in $(seq 1 30); do | ||
| if codex_reviewed; then | ||
| echo "Codex has reviewed this PR." | ||
| exit 0 | ||
| fi | ||
| echo "Waiting for Codex review ($i/30)..." | ||
| sleep 30 | ||
| done | ||
| echo "::error::No Codex review on this PR after 15 minutes. Comment '@codex review' on the PR, then re-run this check." | ||
| exit 1 | ||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow explicitly ignores dismissed reviews in the jq filter, but it never runs for the
pull_request_review.dismissedaction. If a Codex review is dismissed after this check has passed, the required status remains green until some unrelated PR event reruns it, so the gate can still report that a non-dismissed Codex review exists when it no longer does; includedismissedin this trigger.Useful? React with 👍 / 👎.