From fee3c43f20ac17e98dd96a8ce07988f5d0dfd120 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ilkka=20Sepp=C3=A4l=C3=A4?= Date: Sun, 12 Jan 2025 18:26:41 +0200 Subject: [PATCH] fix: Update presubmit action --- .github/workflows/presubmit.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml index 43cebfe52..cac1250b7 100644 --- a/.github/workflows/presubmit.yml +++ b/.github/workflows/presubmit.yml @@ -6,8 +6,9 @@ permissions: issues: write on: - pull_request: - pull_request_review_comment: + pull_request_target: # Handle forked repository PRs in the base repository context + types: [opened, synchronize] + pull_request_review_comment: # Handle review comments types: [created] jobs: @@ -20,7 +21,14 @@ jobs: echo "Error: LLM_API_KEY secret is not configured" exit 1 fi - - uses: presubmit/ai-reviewer@latest + + - name: Check out PR code + uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha }} + + - name: Run AI Reviewer + uses: presubmit/ai-reviewer@latest env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} LLM_API_KEY: ${{ secrets.LLM_API_KEY }}