anthropics / anthropics/claude-code-action

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

Offen
#46 18 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
p2
Vorherrschende Sprache
TypeScript
Sterne
8.9k
Forks
2.1k
Ø Merge
3 T. 9 Std.
Gemergte PRs (30 T.)
10

Beschreibung

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?

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.