anthropics / anthropics/claude-code-action

Comments in (forked) PR trigger claude-code-action with wrong branch

Ouverte
#46 18 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
p2
Langage dominant
TypeScript
Étoiles
8.9k
Forks
2.1k
Merge moyen
3 j 9 h
PR mergées (30 j)
10

Description

I am using the https://github.com/anthropics/claude-code-action/blob/main/examples/claude.yml workflow.

According to https://github.com/orgs/community/discussions/25917,

> Comments on issues and pull requests will have the ref [set to the default branch](https://help.github.com/en/articles/events-that-trigger-workflows). However, you should be able to inspect the full [github event context ](https://help.github.com/en/articles/contexts-and-expression-syntax-for-github-actions#contexts)for the information about the pull request in question.

Workflow triggered by issue_comment (thus a comment in PR) will checkout to the base branch, which provides wrong context for claude-code to work with.

What is the suggested way to fix this?

- Prompt Claude to let it checkout to the PR branch automatically?
- Make the action `actions/checkout@v4` checkout to the correct branch if on PR comments?

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.