]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Improve droid code review workflow: use Sonnet, add explicit completion comme...
authorVsevolod Stakhov <vsevolod@rspamd.com>
Wed, 12 Nov 2025 11:27:23 +0000 (11:27 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Wed, 12 Nov 2025 11:27:23 +0000 (11:27 +0000)
.github/workflows/droid-code-review.yml

index 363061f5cd7f78cd9304a245d618c0b1abeca0a5..0596d1a83b12f811ae98bea1a056c4c61beff199 100644 (file)
@@ -193,16 +193,30 @@ jobs:
 
           # Run droid exec with the prompt
           echo "Running code review analysis and submitting results..."
-          droid exec --auto high --model gpt-5-codex -f prompt.txt
+          droid exec --auto high --model claude-sonnet-4-5-20250929 -f prompt.txt
 
-      - name: Mark review as complete
+      - name: Post review completion comment
         if: ${{ success() }}
         run: |
-          gh api \
-            --method POST \
-            -H "Accept: application/vnd.github+json" \
-            /repos/${{ github.repository }}/issues/comments/${{ github.event.comment.id }}/reactions \
-            -f content='+1'
+          gh pr comment ${{ github.event.issue.number }} --body "Code review completed successfully. The review has been submitted."
+        env:
+          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+
+      - name: Dismiss previous change requests if approved
+        if: ${{ success() }}
+        run: |
+          # Get all reviews for this PR
+          REVIEWS=$(gh api "/repos/${{ github.repository }}/pulls/${{ github.event.issue.number }}/reviews" --jq '.[] | select(.state == "CHANGES_REQUESTED" and .user.login == "github-actions[bot]") | .id')
+
+          # Dismiss each change request review
+          for REVIEW_ID in $REVIEWS; do
+            echo "Dismissing review $REVIEW_ID"
+            gh api \
+              --method PUT \
+              -H "Accept: application/vnd.github+json" \
+              "/repos/${{ github.repository }}/pulls/${{ github.event.issue.number }}/reviews/$REVIEW_ID/dismissals" \
+              -f message="Dismissed after new approval" || echo "Failed to dismiss review $REVIEW_ID (may already be dismissed)"
+          done
         env:
           GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}