Description
The branch name validation in src/github/operations/branch.ts rejects branch names containing @, even though @ is a valid character in git branch names. This causes the action to fail on PRs with @ in the branch name.
Steps to Reproduce
- Create a PR from a branch with
@ in the name, e.g. TICKET-123@add-feature
- The Claude PR review workflow triggers
- The prepare step fails with:
Prepare step failed with error: Invalid branch name: "TICKET-123@add-feature".
Branch names must start with an alphanumeric character and contain only alphanumeric characters,
forward slashes, hyphens, underscores, or periods.
Root Cause
The allowlist regex in src/github/operations/branch.ts:
const validPattern = /^[a-zA-Z0-9][a-zA-Z0-9/_.-]*$/;
Does not include @ in the allowed character set. While @{ is a special git reflog syntax (and is correctly rejected separately), a standalone @ or @ followed by non-{ characters is perfectly valid in git branch names.
Expected Behavior
Branch names containing @ (but not @{) should be accepted. The regex could be updated to:
const validPattern = /^[a-zA-Z0-9][a-zA-Z0-9/_.@-]*$/;
With the existing @{ check still catching the unsafe git reflog syntax.
Environment
- Action version: v1.0.27
- Event:
pull_request
Impact
Any PR with @ in the branch name will fail the Claude review workflow. This is a common pattern in some teams (e.g. TICKET@description convention).
Description
The branch name validation in
src/github/operations/branch.tsrejects branch names containing@, even though@is a valid character in git branch names. This causes the action to fail on PRs with@in the branch name.Steps to Reproduce
@in the name, e.g.TICKET-123@add-featureRoot Cause
The allowlist regex in
src/github/operations/branch.ts:Does not include
@in the allowed character set. While@{is a special git reflog syntax (and is correctly rejected separately), a standalone@or@followed by non-{characters is perfectly valid in git branch names.Expected Behavior
Branch names containing
@(but not@{) should be accepted. The regex could be updated to:With the existing
@{check still catching the unsafe git reflog syntax.Environment
pull_requestImpact
Any PR with
@in the branch name will fail the Claude review workflow. This is a common pattern in some teams (e.g.TICKET@descriptionconvention).