anthropics / anthropics/claude-code-action

Feature: Create new branch for open PRs

Open
#829 0 comments 1 reaction 0 assignees View on GitHub
feature-request p2
Dominant language
TypeScript
Stars
8.9k
Forks
2.1k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

Hi there!

Right now when Claude is triggered on an open PR (via `@claude` mentions), it pushes commits directly to the PR branch. I've noticed this can be limiting in some workflows:

1. CI checks don't seem to run because commits from `github-actions[bot]` don't trigger workflows
2. Changes go directly into the PR without a way to review them separately first

I saw this mentioned in #319 and #828.

Would it make sense to have an option to create a new branch from the PR branch instead of pushing directly? Something like:

```yaml
- uses: anthropics/claude-code-action@v1
with:
use_new_branch_for_open_prs: true
```

If enabled, it could:
- Create a new branch from the PR's head branch (like `claude/pr-123-fix`)
- Commit changes there
- Provide a link to create a PR from that branch back to the original PR branch

This might let CI run on the new branch, and give a chance to review the changes before merging.

**Example workflow:**
1. I have PR `#123` from `feature-branch`
2. I comment `@claude fix the failing tests`
3. Claude creates `claude/pr-123-fix` from `feature-branch`
4. CI could run on the new branch
5. I could review and merge it back to `feature-branch`

This would be opt-in (default `false`) to avoid changing existing behavior. If this seems useful, I'd be happy to try implementing it!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.