Skip to content

chore(.github): add concurrency control and restrict claude-review to repository PRs#119

Merged
dclong merged 1 commit into
mainfrom
push-lluwsvnxznww
Jul 23, 2026
Merged

chore(.github): add concurrency control and restrict claude-review to repository PRs#119
dclong merged 1 commit into
mainfrom
push-lluwsvnxznww

Conversation

@dclong

@dclong dclong commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • chore(workflows): add concurrency control and restrict claude-review to repository PRs

Changed files

Modified

  • .github/workflows/claude-code-review.yml (+11/-5)

Commits

  • 6d56bba chore(workflows): add concurrency control and restrict claude-review to repository PRs

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@dclong

dclong commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator Author

Claude finished @dclong's task in 1m 2s —— View job


Claude finished @dclong's task

Review: .github/workflows/claude-code-review.yml

Change 1 — concurrency block (lines 13-15)

concurrency:
  group: claude-review-${{ github.event.pull_request.number }}
  cancel-in-progress: true

Groups runs per-PR and cancels a stale in-progress review when a new synchronize push comes in. This is correct and avoids wasted/overlapping review runs on rapid force-pushes.

Change 2 — job if: condition (lines 19-25)

if: |
  github.event.pull_request.head.repo.full_name == github.repository
  && github.event.pull_request.draft == false

This restricts the review job to PRs whose head branch lives in this repository (not a fork) and that are not drafts.

  • Correctness: multi-line if: expressions joined with a leading && on the continuation line are a well-established GitHub Actions pattern (matches the previously commented-out example in this same file) and parse/evaluate correctly.
  • Null-safety: if a fork PR's head repo has been deleted, github.event.pull_request.head.repo is null; GitHub Actions expressions return null (not an error) for property access on null, so null == github.repository safely evaluates to false rather than throwing.
  • Security rationale (per the added comment): this workflow runs on pull_request (not pull_request_target), so secrets — including the ACTIONS_TOKEN PAT used to post the review comment — are available to the job even though it checks out the PR's head ref. Without this guard, a forked PR's attacker-controlled title/description could prompt-inject the AUTO_MERGE_APPROVED marker into a comment posted via a token belonging to an auto-merge allowlisted user. Restricting to same-repo, non-draft PRs closes that path. This is a legitimate and worthwhile hardening.
  • The draft == false check is redundant with the ready_for_review trigger type (which only fires once a PR leaves draft) but is harmless defense-in-depth for opened/synchronize/reopened events that could still target a draft PR.

No correctness bugs or blocking issues found. This is a small, well-scoped, security-motivated change.

AUTO_MERGE_APPROVED

@dclong
dclong merged commit 2217520 into main Jul 23, 2026
9 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.

1 participant