From 6d50221dd52eaf26afd872b17d8ae78834d1adeb Mon Sep 17 00:00:00 2001 From: nrslib <38722970+nrslib@users.noreply.github.com> Date: Sat, 28 Feb 2026 12:06:13 +0900 Subject: [PATCH] =?UTF-8?q?ci:=20PR=E3=81=AB=E5=AF=BE=E3=81=99=E3=82=8BTAK?= =?UTF-8?q?T=20Review=E3=83=AF=E3=83=BC=E3=82=AF=E3=83=95=E3=83=AD?= =?UTF-8?q?=E3=83=BC=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Environment承認方式で、メンテナーが承認するまで実行されない。 レビュー結果はPRコメントとアーティファクトに出力。 --- .github/workflows/takt-review.yml | 58 +++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/takt-review.yml diff --git a/.github/workflows/takt-review.yml b/.github/workflows/takt-review.yml new file mode 100644 index 0000000..d775420 --- /dev/null +++ b/.github/workflows/takt-review.yml @@ -0,0 +1,58 @@ +name: TAKT PR Review + +on: + pull_request: + types: [opened, synchronize, ready_for_review] + +jobs: + review: + runs-on: ubuntu-latest + environment: takt-review + permissions: + contents: read + pull-requests: write + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.ref }} + fetch-depth: 0 + + - uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Claude Code & TAKT インストール + run: | + npm install -g @anthropic-ai/claude-code + npm install -g takt + + - name: TAKT Review 実行 + run: takt --pipeline --skip-git -i ${{ github.event.pull_request.number }} -w review + env: + ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: レビュー結果をPRコメントに投稿 + if: always() + run: | + REPORT_DIR=$(ls -td .takt/runs/*/reports 2>/dev/null | head -1) + if [ -n "$REPORT_DIR" ]; then + SUMMARY=$(find "$REPORT_DIR" -name "*review-summary*" -type f | head -1) + if [ -n "$SUMMARY" ]; then + gh pr comment ${{ github.event.pull_request.number }} --body-file "$SUMMARY" + else + echo "レビューサマリーが見つかりません" + fi + else + echo "レポートディレクトリが見つかりません" + fi + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: レビューレポートをアーティファクトに保存 + if: always() + uses: actions/upload-artifact@v4 + with: + name: takt-review-reports + path: .takt/runs/*/reports/ + if-no-files-found: ignore