diff --git a/.github/workflows/code-review.yml b/.github/workflows/code-review.yml index d1d50e7..872b5ec 100644 --- a/.github/workflows/code-review.yml +++ b/.github/workflows/code-review.yml @@ -1,7 +1,13 @@ name: "Claude Code Review" + on: pull_request: types: [ opened, reopened, synchronize ] + +concurrency: + group: claude-review-${{ github.event.pull_request.number }} + cancel-in-progress: true + jobs: review: runs-on: ubuntu-latest @@ -48,6 +54,9 @@ jobs: author { login } + reactions { + totalCount + } } } } @@ -55,7 +64,7 @@ jobs: } } }' \ - --jq '.data.repository.pullRequest.reviewThreads.nodes[] | select(.isResolved == false) | select([.comments.nodes[].author.login] | all(. == "github-actions")) | .comments.nodes[].databaseId' \ + --jq '.data.repository.pullRequest.reviewThreads.nodes[] | select(.isResolved == false) | select([.comments.nodes[].author.login] | all(. == "github-actions")) | select([.comments.nodes[].reactions.totalCount] | add == 0) | .comments.nodes[].databaseId' \ | while read comment_id; do if [ -n "$comment_id" ]; then echo "🗑️ 인라인 코멘트 삭제: $comment_id" diff --git a/.github/workflows/comment-response.yml b/.github/workflows/comment-response.yml new file mode 100644 index 0000000..d8f2ea7 --- /dev/null +++ b/.github/workflows/comment-response.yml @@ -0,0 +1,31 @@ +name: Claude Issue & PR Comment Response + +on: + issue_comment: + types: [ created ] + pull_request_review_comment: + types: [ created ] + +concurrency: + group: claude-comment-${{ github.event.issue.number }}-${{ github.event.comment.id }} + cancel-in-progress: false + +jobs: + respond: + if: | + github.event.comment.user.login != 'github-actions[bot]' && + contains(github.event.comment.body, '@claude') && + (github.event.comment.author_association == 'MEMBER' || + github.event.comment.author_association == 'OWNER' || + github.event.comment.author_association == 'COLLABORATOR') + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + issues: write + steps: + - uses: actions/checkout@v4 + - uses: anthropics/claude-code-action@v1 + with: + claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} + github_token: ${{ secrets.GITHUB_TOKEN }}