anthropics / anthropics/claude-code-action

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

未关闭
#46 18 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
p2
主要语言
TypeScript
星标
8.9k
派生
2.1k
平均合并
3 天 9 小时
30 天内合并 PR
10

描述

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?

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。