Skip to content

[WRONG BRANCH] Require trusted GitHub Actions ci check before marking contributor PRs ready - #270

Draft
luvs01 wants to merge 1 commit into
mainfrom
codex/propose-fix-for-ci-verification-vulnerability
Draft

[WRONG BRANCH] Require trusted GitHub Actions ci check before marking contributor PRs ready#270
luvs01 wants to merge 1 commit into
mainfrom
codex/propose-fix-for-ci-verification-vulnerability

Conversation

@luvs01

@luvs01 luvs01 commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Restore bot-side verification of the repository's trusted GitHub Actions ci aggregate so a contributor cannot self-attest CI and have the gate mark a PR ready when the trusted ci check is missing, pending, failing, truncated, or produced by an untrusted app.

Description

  • Reintroduced the checks.listForRef evidence path and ciGreen handling so the readiness gate only treats the local-CI box as verified when the trusted GitHub Actions App (id 15368) reports a completed ci check with conclusion success, and treat missing/pending/foreign/truncated evidence as a fail-closed condition.
  • Mapped ci_green into the claim/indexing paths and updated message builders so the gate unticks the CI checklist box and resets/drafts the PR when CI fails or is unverifiable.
  • Updated unit and integration tests exercising the readiness/claim logic and fixed the readiness checklist index mappings; also updated user-facing docs and AGENTS/MAINTAINERS guidance to match the restored behaviour.
  • Key files changed: .github/workflows/enforce-pr-target.yml, .github/scripts/pr-quality-state.cjs, .github/scripts/pr-quality.cjs, .github/scripts/pr-quality-messages.cjs plus tests under tests/ and docs in docs-site/, AGENTS.md, and MAINTAINERS.md.

Testing

  • Ran the JavaScript unit suites with node --test .github/scripts/pr-quality*.test.cjs and the updated script tests passed.
  • Ran TypeScript checks with bun run typecheck and the typecheck completed without error.
  • Exercised the PR-readiness scenarios via the repository harness and targeted Bun tests (including the updated tests/ci-workflows.test.ts), which validated the new CI-evidence branches; the harness and updated unit tests passed for the changed readiness paths.
  • The full cross-platform prepush flow was attempted (bun run prepush / GUI build), but unrelated CI environment issues (GUI integration npm registry fetches returning HTTP 403 and a few long-suite timeouts) prevented a complete green run of the entire repository test matrix in this environment.

Codex Task

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@luvs01, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 19 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 4f235d09-f939-480e-a2b6-263a4574135e

📥 Commits

Reviewing files that changed from the base of the PR and between 1193075 and 700ab56.

📒 Files selected for processing (12)
  • .github/scripts/pr-quality-messages.cjs
  • .github/scripts/pr-quality-messages.test.cjs
  • .github/scripts/pr-quality-state.cjs
  • .github/scripts/pr-quality-state.test.cjs
  • .github/scripts/pr-quality.cjs
  • .github/scripts/pr-quality.test.cjs
  • .github/workflows/enforce-pr-target.yml
  • AGENTS.md
  • MAINTAINERS.md
  • docs-site/src/content/docs/contributing/pr-quality.md
  • tests/ci-workflows.test.ts
  • tests/helpers/enforce-pr-target-harness.ts

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Aug 13, 2026
@github-actions github-actions Bot changed the title Require trusted GitHub Actions ci check before marking contributor PRs ready [WRONG BRANCH] Require trusted GitHub Actions ci check before marking contributor PRs ready Aug 13, 2026
@github-actions

github-actions Bot commented Aug 13, 2026

Copy link
Copy Markdown

⏳ DRAFT

  • wrong target branch (main); retarget to dev.

What to do

  • Retarget this PR to dev — all contributions go to dev.

Its title has been prefixed with [WRONG BRANCH].
This pull request was already a draft. Its draft status will be preserved after every issue above is resolved.

@github-actions
github-actions Bot marked this pull request as draft August 13, 2026 01:12

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 700ab5660c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

// any installed app can publish a check called `ci`.
const githubActionsAppId = 15368;
const { data: checksData } =
await github.rest.checks.listForRef({

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add checks: read to the enforcement job

The enforce-target job declares only contents: write and pull-requests: write at lines 143–146; because job-level permissions set every omitted scope to none, this new checks.listForRef request lacks the required checks: read permission. On every completed contributor checklist the request therefore fails, ciGreen remains false, and the fail-closed path permanently unticks the CI box instead of ever marking the PR ready. Add checks: read to this job's permissions.

AGENTS.md reference: AGENTS.md:L218-L224

Useful? React with 👍 / 👎.

Comment on lines +878 to +881
const ciChecks = checkRuns.filter(
check =>
check.name === "ci" &&
check.app?.id === githubActionsAppId

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Verify CI came from the trusted workflow definition

For a contributor PR that changes .github/workflows/ci.yml, filtering by the GitHub Actions App ID proves only which app published the check, not that trusted CI logic ran. This repository explicitly records at .github/workflows/ci.yml:61-67 that the pull_request workflow is loaded from the PR head, so an author can replace the aggregate ci job with a trivial success and satisfy this test without running the real gates. Reject readiness when the CI workflow differs from the trusted base, or consume evidence produced from a workflow definition outside contributor control.

AGENTS.md reference: AGENTS.md:L218-L224

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aardvark bug Something isn't working codex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant