fix: takt-review を pull_request_target に変更して fork PR でもシークレットを利用可能に

- pull_request → pull_request_target でベースリポジトリのコンテキストで実行
- fork リポジトリからのチェックアウトに repository を追加
- ANTHROPIC_API_KEY が空の場合に即座にエラー終了するガードを追加
This commit is contained in:
nrslib 2026-02-28 17:34:41 +09:00
parent e5665ed8cd
commit 5fd9022caa

View File

@ -1,7 +1,7 @@
name: TAKT PR Review
on:
pull_request:
pull_request_target:
types: [opened, synchronize, ready_for_review, reopened]
jobs:
@ -15,8 +15,18 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
fetch-depth: 0
- name: API キー確認
run: |
if [ -z "$ANTHROPIC_API_KEY" ]; then
echo "::error::ANTHROPIC_API_KEY is not set"
exit 1
fi
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
- uses: actions/setup-node@v4
with:
node-version: 20