Skip to content

fix(ci): make the AI review workflow run under pull_request_target - #1153

Merged
ocandocrypto-uniswap merged 2 commits into
Uniswap:mainfrom
wkoutre:nickkoutrelakos/fix-ai-review-oidc-pull-request-target
Sep 2, 2026
Merged

fix(ci): make the AI review workflow run under pull_request_target#1153
ocandocrypto-uniswap merged 2 commits into
Uniswap:mainfrom
wkoutre:nickkoutrelakos/fix-ai-review-oidc-pull-request-target

Conversation

@wkoutre

@wkoutre wkoutre commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

The AI review check has failed on every PR since the workflow landed in #1139. The action trades an OIDC token for a Claude GitHub App token, and Anthropic's exchange rejects tokens minted under pull_request_target (see anthropics/claude-code-action#713, open since December with no fix released).

This passes the job token to the action instead, which skips the exchange entirely. It also allows non-write actors so community PRs are reviewed, since the action otherwise refuses them. id-token: write is dropped because nothing uses it anymore.

Comments will post as github-actions[bot] instead of claude[bot]. Nothing else about the review changes: the PR head is still never checked out, and the tools are still limited to reading the diff and posting comments.

Type of change

  • Fix (typo, broken link, incorrect or outdated content)
  • New content (guide, page, code example)
  • Update to existing content
  • Other

How has this been verified?

Read the action source at the pinned commit: when github_token is set, setupGitHubToken() returns it before any OIDC request, and allowed_non_write_users is the documented bypass for the write-permission check. This is also the shape the action maintainers describe for pull_request_target in their draft docs. actionlint passes on the file.

A PR that changes this workflow cannot test itself: pull_request_target runs the base branch's definition. The first real run is the next PR opened after this merges.

Anything else reviewers should know?

The "Actor does not have write permissions" refusal is a separate check from the OIDC exchange. Fixing only the token would move the failure to that check for every community author, so both settings are needed together.

The review job has failed on every PR since it landed. The action trades
an OIDC token for a Claude GitHub App token, and Anthropic's exchange
rejects tokens minted under `pull_request_target`
(anthropics/claude-code-action#713).

Pass the job token instead, which skips the exchange, and allow
non-write actors so community PRs are reviewed. Drop the now-unused
`id-token: write` permission. Comments will post as github-actions[bot].
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-02T00:18:09.326587Z 24a89b4 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown

Thanks for contributing to Uniswap Docs! 🦄

Quick heads up on how this repo works: the docs you see on developers.uniswap.org are built from a separate source repo. When we accept a change here, we port it over there, so your fix might show up on the live site before it lands in this repo.

Updates to this repo come in batches on a regular cadence. When yours is included, you'll be credited as a co-author on the commit, so the contribution counts on your GitHub profile and in Uniswap/docs.

We review every PR but can't merge everything. Either way, someone from the docs team will follow up here once we've taken a look.

One legal bit: by submitting a PR you agree your contribution is licensed under the repo's MIT license.

@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: 24a89b4a10

ℹ️ 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".

# exactly this shape: a job token scoped to `pull-requests: write`, the
# PR head never checked out, and tools limited to reading the diff and
# posting comments.
allowed_non_write_users: '*'

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 Remove shell-expanded comments before allowing every author

For any public fork PR authored by a non-writer, this wildcard lets attacker-controlled diff text reach Claude while the action has both the Claude OAuth credential and a writable GitHub token. The existing Bash(gh pr comment:*) permission can be prompt-injected into running a still-allowed command such as gh pr comment ... --body "$CLAUDE_CODE_OAUTH_TOKEN"; shell expansion exposes the secret without needing a separate forbidden read command, and gh explicitly accepts arbitrary text via --body (GitHub CLI manual). Replace the shell-capable comment permission with a structured comment tool, or otherwise prevent credentials from being available to that shell, before permitting *.

Useful? React with 👍 / 👎.

@ocandocrypto-uniswap
ocandocrypto-uniswap merged commit 1df1c3e into Uniswap:main Sep 2, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants