anthropics / anthropics/claude-code-action

Feature: Create new branch for open PRs

Aperta
#829 0 commenti 1 reazione 0 assegnatari Vedi su GitHub
feature-request p2
Lingua principale
TypeScript
Stelle
8.9k
Fork
2.1k
Merge medio
3g 9h
PR unite (30g)
10

Descrizione

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!

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.