From 312cec0b865edf5b0e3ad1404fb48943c4030a8c Mon Sep 17 00:00:00 2001 From: Hao Date: Wed, 9 Apr 2025 13:37:34 +1000 Subject: [PATCH] Create presubmit.yml --- .github/workflows/presubmit.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/presubmit.yml diff --git a/.github/workflows/presubmit.yml b/.github/workflows/presubmit.yml new file mode 100644 index 000000000..423811de9 --- /dev/null +++ b/.github/workflows/presubmit.yml @@ -0,0 +1,28 @@ +name: Presubmit.ai + +permissions: + contents: read + pull-requests: write + issues: write + +on: + pull_request_target: + types: [opened, synchronize] + pull_request_review_comment: + types: [created] + +jobs: + review: + runs-on: ubuntu-latest + steps: + - name: Check required secrets + run: | + if [ -z "${{ secrets.LLM_API_KEY }}" ]; then + echo "Error: LLM_API_KEY secret is not configured" + exit 1 + fi + - uses: presubmit/ai-reviewer@latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + LLM_API_KEY: ${{ secrets.LLM_API_KEY }} + LLM_MODEL: "claude-3-5-sonnet-20241022"