Skip to content

Add Claude review workflow for Nexus team PRs#10420

Open
stephanos wants to merge 9 commits into
mainfrom
stephanos/claude-nexus-pr-review
Open

Add Claude review workflow for Nexus team PRs#10420
stephanos wants to merge 9 commits into
mainfrom
stephanos/claude-nexus-pr-review

Conversation

@stephanos
Copy link
Copy Markdown
Contributor

@stephanos stephanos commented May 28, 2026

What changed?

Added new GitHub Action workflow to request Claude Code review on a PR.

Why?

The goal is to automate this, but for now we'll test it manually first, ie workflow_dispatch.

stephanos and others added 3 commits May 28, 2026 16:20
Triggers anthropics/claude-code-action on PR open when the author is
an active member of the temporalio/nexus team.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Trigger on opened/reopened/ready_for_review; skip drafts
- Switch to pull_request_target so forked PRs from team members work
- Move permissions to the review job; drop unused id-token
- Add timeout-minutes to both jobs
- Distinguish 404 (not a member) from real gh api errors
- Explicitly check out PR head SHA after the team-membership gate

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@temporalio temporalio deleted a comment from github-actions Bot May 28, 2026
@temporalio temporalio deleted a comment from semgrep-managed-scans Bot May 28, 2026
Satisfies security.gha.missing-explicit-permissions lint. The job uses
TEAM_READ_TOKEN exclusively and needs no GITHUB_TOKEN scopes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@stephanos stephanos force-pushed the stephanos/claude-nexus-pr-review branch from c8bc8d1 to 58f8047 Compare May 28, 2026 23:40
stephanos and others added 4 commits May 28, 2026 16:41
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Lets you fire the workflow against an arbitrary open PR without merging:
  gh workflow run claude-review-teams.yml \
    --ref stephanos/claude-nexus-pr-review -f pr_number=10420

The resolve step uses GITHUB_TOKEN (pull-requests: read) to look up the
PR's author and head SHA, then the membership check uses TEAM_READ_TOKEN
as before.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Avoids introducing a new PAT secret; reuses the existing GitHub App
credentials (TEMPORAL_CICD_APP_ID, TEMPORAL_CICD_PRIVATE_KEY) already
used by ci-success-report.yml. The same token serves both the PR
lookup (workflow_dispatch path) and the org team-membership check.

Per Tom: app needs members:read on org permissions for team lookups
to succeed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Leaves workflow_dispatch as the only trigger so we can validate the
workflow against real PRs without auto-firing on every new PR. Re-enable
the auto-trigger once end-to-end behavior is confirmed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@stephanos stephanos marked this pull request as ready for review May 29, 2026 00:23
@stephanos stephanos requested review from a team as code owners May 29, 2026 00:23
@stephanos stephanos requested review from S15 and long-nt-tran May 29, 2026 00:23
# workflow end-to-end via workflow_dispatch. Re-enable once we've confirmed
# the membership check and review behave as expected on real PRs.
# pull_request_target:
# types: [opened, reopened, ready_for_review]
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

no way to test this without merging, so disabling for now ...

Confine the generated token to members:read (team lookups) and
pull-requests:read (workflow_dispatch PR lookup) instead of the app's
full installation permissions.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

jobs:
check-membership:
if: github.event_name == 'workflow_dispatch' || github.event.pull_request.draft == false
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

with PR target enabled, does this end up running on every push that isn't a draft? just making sure I'm reading it right.

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