Skip to content

fix: allow Unicode letters in branch name validation#1025

Open
Jah-yee wants to merge 4 commits intoanthropics:mainfrom
Jah-yee:fix/unicode-branch-names
Open

fix: allow Unicode letters in branch name validation#1025
Jah-yee wants to merge 4 commits intoanthropics:mainfrom
Jah-yee:fix/unicode-branch-names

Conversation

@Jah-yee
Copy link

@Jah-yee Jah-yee commented Mar 6, 2026

Summary

This PR adds multiple fixes for branch validation and permission checking:

1. Unicode Branch Names (#1020)

  • Allows branch names with Unicode characters (e.g., Japanese like 機能/fix)
  • Uses Unicode property escapes (\p{L} for letters, \p{N} for numbers)

2. Azure DevOps # Character (#1024)

  • Allows # in branch names for Azure DevOps ticket linking
  • Azure DevOps uses # for ticket linking (e.g., feature/AB#1992-sentry)

3. Shell Comment Stripping (#1019)

  • Strips lines starting with # before parsing claude_args
  • Allows users to add documentation comments without breaking flags

4. Copilot Permission Check (#1018)

  • Adds Copilot to the bypass list for permission checking
  • Copilot-initiated workflows return 404 for user permission lookup

Changes

  • Modified validPattern regex for Unicode and # support
  • Added comment stripping in parseClaudeArgsToExtraArgs()
  • Added Copilot check alongside [bot] accounts

Related

Fixes #1020, Fixes #1024, Fixes #1019, Fixes #1018

Jah-yee added 4 commits March 7, 2026 02:57
Previously, validateBranchName only allowed ASCII alphanumeric characters,
rejecting valid Unicode branch names (e.g., Japanese characters).

This fix uses Unicode property escapes (\p{L} for letters, \p{N} for numbers)
to allow valid Unicode branch names while still blocking dangerous characters.

Fixes: anthropics#1020
Azure DevOps uses # for ticket linking in branch names (e.g., feature/AB#1992).
This fix adds # to the allowed characters in branch name validation.

Fixes: anthropics#1024
shell-quote treats # as a comment character, causing all content after
a comment line to be swallowed.

This fix strips lines starting with # before passing to parseShellArgs,
so users can add documentation comments to their claude_args without
breaking subsequent flags.

Fixes: anthropics#1019, anthropics#802
checkWritePermissions() calls repos.getCollaboratorPermissionLevel()
with github.actor as username. When actor is Copilot (from Copilot-
initiated pull_request_review), the API returns 404 because Copilot
is not a regular GitHub user.

This fix adds Copilot to the bypass list alongside [bot] accounts.

Fixes: anthropics#1018
Copy link

Choose a reason for hiding this comment

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

LGTM.

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

Labels

None yet

Projects

None yet

2 participants