diff --git a/.github/workflows/pr-opened.yml b/.github/workflows/pr-opened.yml new file mode 100644 index 0000000..90141bc --- /dev/null +++ b/.github/workflows/pr-opened.yml @@ -0,0 +1,40 @@ +name: PR Opened - Auto Review + +on: + pull_request: + types: [opened, synchronize] + +jobs: + auto-review: + runs-on: ubuntu-latest + permissions: + pull-requests: write + contents: read + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Add PR labels + uses: actions/github-script@v7 + with: + script: | + const labels = ['👀 state:reviewing', '🎯 phase:review']; + + await github.rest.issues.addLabels({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + labels: labels + }); + + - name: Comment on PR + uses: actions/github-script@v7 + with: + script: | + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + body: '🤖 自動レビュー開始\n\nコードレビューを実施しています...' + });