commit e85b72901bbce9af9470099b45ad51bc7686ef95
parent dc44230ba22073074f4b7dc9cd03d87da06ad97d
Author: andrewlaack-collab <andrew.laack@imbue.com>
Date: Tue, 10 Feb 2026 06:08:04 +0000
Updated ci config to match recommendation (#44)
Diffstat:
2 files changed, 43 insertions(+), 25 deletions(-)
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
@@ -27,28 +27,3 @@ jobs:
- name: Run tests
run: uv run pytest
-
- - name: Fetch main branch for vet comparison
- if: github.event_name == 'pull_request'
- run: git fetch origin main:main
-
- - name: Run vet
- if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
- env:
- ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- VET_GOAL: |
- ${{ github.event.pull_request.title }}
-
- Additional context (not necessarily part of the goal):
- ${{ github.event.pull_request.body }}
- run: |
- set +e
- uv run vet "$VET_GOAL" --base-commit main --confidence-threshold 0.9 --max-workers 4 --quiet --model opus > "$RUNNER_TEMP/vet-output.txt" 2>&1
- status=$?
- if [ ! -s "$RUNNER_TEMP/vet-output.txt" ]; then
- echo "Vet found no issues." > "$RUNNER_TEMP/vet-output.txt"
- fi
- gh pr comment "${{ github.event.pull_request.number }}" --body-file "$RUNNER_TEMP/vet-output.txt"
- if [ "$status" -eq 1 ]; then exit 0; fi
- exit "$status"
diff --git a/.github/workflows/vet.yml b/.github/workflows/vet.yml
@@ -0,0 +1,43 @@
+name: Vet
+
+permissions:
+ contents: read
+ pull-requests: write
+ issues: write
+
+on:
+ pull_request:
+ types: [opened, edited, synchronize, reopened]
+
+jobs:
+ vet:
+ if: github.event.pull_request.draft == false
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ - uses: actions/setup-python@v5
+ with:
+ python-version: "3.11"
+ - run: pip install git+https://github.com/imbue-ai/vet.git
+ - name: Run vet
+ if: github.event.pull_request.head.repo.full_name == github.repository
+ env:
+ ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ VET_GOAL: |
+ ${{ github.event.pull_request.title }}
+
+ Additional context (not necessarily part of the goal):
+ ${{ github.event.pull_request.body }}
+ run: |
+ set +e
+ vet "$VET_GOAL" --quiet --base-commit "${{ github.event.pull_request.base.sha }}" > "$RUNNER_TEMP/vet-output.txt" 2>&1
+ status=$?
+ if [ ! -s "$RUNNER_TEMP/vet-output.txt" ]; then
+ echo "Vet found no issues." > "$RUNNER_TEMP/vet-output.txt"
+ fi
+ gh pr comment "${{ github.event.pull_request.number }}" --body-file "$RUNNER_TEMP/vet-output.txt"
+ if [ "$status" -eq 1 ]; then exit 0; fi
+ exit "$status"